| Issue 843: | commit-msg hook doesn't add new Change-Id line in revert commits | |
| 25 people starred this issue and may be notified of changes. | Back to list |
Affected Version: 2.1.6.1 What steps will reproduce the problem? 1. Create, Upload, Review and Submit a change with a Change-Id line in the commit message 2. Revert that change locally using 'git revert' What is the expected output? What do you see instead? Expected a new Change-Id line but instead the commit-msg hook assumes the line from the reverted commit message is for this change.
May 13, 2011
#1
c.david86@gmail.com
May 20, 2011
Using the new Revert button (2.1.7) is another workaround. Writing a second hook only for git-revert that fixes up the Change-Id is the only other solution I can think of.
Status:
Accepted
Dec 15, 2011
I'm here for the "no ChangeId when I merge" problem as mentioned in comment #1. Should this be a separate ticket?
Sep 7, 2012
I looked into this a tiny bit and it's very annoying. The commit-msg hook is only used for git-commit, not for all git programs that may use the git committing plumbing. It appears git-revert does not invoke the commit-msg hooks: http://git.661346.n2.nabble.com/git-revert-doesn-t-run-commit-msg-hook-td7559622.html (similar discussion: http://git.661346.n2.nabble.com/cherry-pick-pre-commit-hook-td5815961.html) My workaround is to use: git revert -n <commit> git commit Which will then invoke commit-msg, which in-turn adds the Change Id line to the message. I'm using git version 1.7.11.2
Jul 10, 2014
I guess comment #1 should say "This is also the case for merges without conflicts" (i.e. those that do not invoke the editor), as a fast-forward merge by definition does not create a merge commit. |
|
| ► Sign in to add a comment |