git-upstream will fail to subsequently detect any amended import merges
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
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.