git-upstream will fail to subsequently detect any amended import merges

Bug #1548410 reported by Darragh Bailey
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
git-upstream
New
Wishlist
Darragh Bailey

Bug Description

If a developer performs an import, and then subsequently the result fails to pass the desired tests, developers will tend to modify the code locally and simply amend the merge commit with the fix and upload the result for review.

Subsequent usage of 'git upstream' will consequently fail to notice this merge commit was the import merge commit, since the tree no longer matches that which was previously merged in from the import branch.

Net result is that it will attempt to use the next import before that point, thus finding duplicate patch sets and likely resulting in a conflict and/or dropping of the amended change silently as it discards the merge commit.

git-upstream should:
a) attempt to warn users not to modify these import merges possibly by adding a 'do not amend' message to the commit
b) try to better detect when such amended commit is still the import merge commit
c) consider adding a verify import command to allow be executed by CI tooling to prevent such changes being added

Revision history for this message
Darragh Bailey (dbailey-k) wrote :

I think the first item of adding some kind of warning is probably a good starting point and relatively easy to add.

Trying to detect when this happens is potentially tricky, but should be doable. What to do about it when we detect such a problem is a bit harder to establish.

Ideally should document that if a conflict or potential conflict is encountered, how to rework the changes on the import branch, and then recreate the final merge using the '--finish' option.

Still would be preferable to catch the problem.

Verify command should be trivial once the second step is complete.

description: updated
Revision history for this message
Darragh Bailey (dbailey-k) wrote :

I guess the remaining requirement might be a way to automatically extract this amended change if present, and apply it as a new commit which would negate the need for the warning altogether.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.