简体   繁体   中英

Conflict resolution merge commit seems incomplete

There was a feature branch with conflicts. These were resolved and the resolution committed.

Unfortunately, I botched the merge and a couple previously-released features regressed - this is verified by doing a diff between the merge commit sha1 and that of the previous tag.

When I do git show <sha1 for merge commit> all changes are innocuous.

When I do git log -Sunique_variable_added_for_feature_and_lost_after_botched_merge , I only see the commit that added unique_variable_... but not the problematic deletion from the bad merge.

However, when I took the ignominious step of viewing the sha1 for the commit in a gui git client like Tower, I can clearly see the botched lines.

Is there an additional switch used by Tower that I've missed entirely? Why didn't pickaxe pick up the deletion implicit in the merge commit?

Merge commit diffs are by necessity shown as "combined diffs", which display differences compared to all parents of the merge commit. However, git show additionally uses the --cc diff option which shortens the output by only showing conflict resolutions. The non-conflicting hunks, such as the deletion that caused your problems, are skipped as "uninteresting", as the manual explains .

Use git show -c <commit> to request the combined diff in its unabridged form, and you will see all the changes introduced by the merge commit. This is likely what the GUI program does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM