Commit hook error!

179 views
Skip to first unread message

Jacek Ziora

unread,
Jul 5, 2016, 7:53:15 AM7/5/16
to Repo and Gerrit Discussion
Hi,

I have serious problem with commit hook error:
remote: ERROR: [d967719] missing Change-Id in commit message footer
remote:
remote: Hint: A potential Change-IdChange-Id was found, but it was not in the footer (last paragraph) of the commit message.
remote:
remote: Hint: To automatically insert Change-Id, install the hook:

But in commit msg there is already Change-Id. Also "A potential Change-IdChange-Id was found" communicate is weird for me.

Commit msg:
Revert "logcheck remarks"

This reverts commit 6ff5721bbe8d1bda44ec4908c3d6dd4b481c5ae7.

git-svn-id: <repo_address>/trunk@395317 b3e923c4-5104-4be0-ac5e-26e73b769f6b
Change-Id: I398fa4b54315a35de04dfca554c157420f2977c4

Removing line "This reverts..." doesn't help.
It looks like commit hook doesn't work. Can somebody help me with this?

Björn Pedersen

unread,
Jul 5, 2016, 8:21:42 AM7/5/16
to Repo and Gerrit Discussion
Hi,

a guess: You are working on windows? Then an empty line at the end may consist of '\r\n'

The code in jgit for parsing the footer lines (http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java#n561)
only strip the \n, so the last paragraph looks empty, while the ChangeId line is considered to be in the second-to-last block.
Try removing the last empty line in commit?

Björn

Jacek Ziora

unread,
Jul 5, 2016, 9:36:12 AM7/5/16
to Repo and Gerrit Discussion
Hi,

I found the problem. One of commit in tree has wrong commit msg (there was a blank line between Change-ID and git-svn-id).
I've fixed this in git rebase interactive mode. But this means, that sometimes commit hook doesn't work properly for me...

Thanks for help.

Best regards,
Jacek Ziora
Reply all
Reply to author
Forward
0 new messages