Hello,
When running `git cherry-pick` over a range of commits, the command may stop due to conflicts. At that point Git reports the conflict but does not provide an easy way to see which commit is currently being cherry-picked or what patch is being applied.
`git rebase` provides a helpful option for this situation:
`git rebase --show-current-patch`
This prints the patch of the commit that is currently being applied. I believe a similar feature would be useful for `git cherry-pick`.
Currently, when a conflict occurs during a range cherry-pick (e.g. `git cherry-pick A..B`), there is no straightforward command to show the patch of the commit being applied. While it is possible to inspect `.git/CHERRY_PICK_HEAD`and run something like:
`git show $(cat .git/CHERRY_PICK_HEAD)`
this is not very discoverable and requires manual steps.
Proposed feature
Add a command:
`git cherry-pick --show-current-patch`
which would display the patch of the commit currently being applied during an in-progress cherry-pick operation (similar to `git rebase --show-current-patch`).
Behavior could be:
* If a cherry-pick is in progress, show the patch corresponding to `CHERRY_PICK_HEAD`. * If no cherry-pick is in progress, report an appropriate error.
Motivation
This would help users:
* understand which commit caused the conflict * review the exact changes being applied * debug large range cherry-picks more easily
It would also provide feature parity with `git rebase`.
Best regards Florian
-- Florian Best Open Source Software Engineer Geschäftsführer: Peter H. Ganten, Stefan Gohmann HRB 20755 Amtsgericht Bremen Steuer-Nr.: 71-597-02876 Univention GmbH Mary-Somerville-Str. 1 28359 Bremen Germany / Deutschland 📞 Phone : +49 421 22232-0 🖶 Fax : +49 421 22232-99 ✉️best@univention.de 🌐https://www.univention.de / https://www.univention.com Managing Directors: Peter H. Ganten, Stefan Gohmann Local court: Amtsgericht Bremen HRB 20755 / Steuer-Nr.: 71-597-02876 The information contained in this message is confidential or protected by law. If you are not the intended recipient, please contact the sender and delete this message. Any unauthorized copying of this message or unauthorized distribution of the information contained herein is prohibited. Legally required information for business correspondence: Legal Information Diese E-Mail enthält vertrauliche oder rechtlich geschützte Informationen. Wenn Sie nicht der beabsichtigte Empfänger sind, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet. Gesetzliche Pflichtangaben für Geschäftskorrespondenz: Datenschutzerklärung