Add 'from commit' information to cherry-picked commits
When cherry-picking a commit, we don't record anything about the original commit (the one that was cherry-picked).
git cherry-pick
has a -x
option: https://git-scm.com/docs/git-cherry-pick#_options This adds '(cherry picked from commit $SHA)' to the new commit message.
You can cherry-pick from two places:
- A commit page. We should add the equivalent of
-x
here. - A merged MR page. We should add all of the original commit messages and SHAs from the MR here, in the same way as you'd get when doing
git rebase --interactive
and squashing commits together.
Original description
Description
When cherry-picking a MR, one gets a single commit that contains the changes but squashed, and the author is the person who initiated the cherry-pick. The commit itself doesn't even have enough information to find a trace of what commits where brought in.
Proposal
While it's useful to record who did the cherry-pick, we would like to have the option to do a proper cherry-picking of each individual commit and use a merge into the target branch, when cherry-picking an MR.