Change-Id
line before any Signed-off-by
or Acked-by
lines placed
at the end of the commit message by the author, but if no such
lines are present then it will just insert a blank line, and add
the Change-Id
at the bottom of the message."ERROR: missing Change-Id in commit message
When I remove this blank line (using git commit --amend) and push again - everything works.
But the problem is, that I push commits using script and when one push failed, no more commits are pushed...
I will try to edit this commit hook to add Change-Id on the last line of commit msg, but I think this doesn't work properly.
Best regards,
Jacek Ziora
Hi!
I think that I found an error in commit-msg hook in gerrit.
From documentation:
"The hook implementation is reasonably intelligent at inserting theChange-Id
line before anySigned-off-by
orAcked-by
lines placed at the end of the commit message by the author, but if no such lines are present then it will just insert a blank line, and add theChange-Id
at the bottom of the message."
In my commit messages I have always this in footer:
git-svn-id: <repo_name> <hash>
And commit-msg hook adds Change-Id before this, so I have:
Change-Id: I4b186c6b4582104c1b91d36fe93d4613783c490b
git-svn-id: <repo_name> <hash>
BUT!
Sometimes (about 2% of commits) situation is that Change-Id is added with the blank line between Change-Id and git-svn-id, like this:
Change-Id: I4b186c6b4582104c1b91d36fe93d4613783c490b
git-svn-id: <repo_name> <hash>
And then gerrit doesn't allow to push such commit with error:ERROR: missing Change-Id in commit message
When I remove this blank line (using git commit --amend) and push again - everything works.
But the problem is, that I push commits using script and when one push failed, no more commits are pushed...
I will try to edit this commit hook to add Change-Id on the last line of commit msg, but I think this doesn't work properly.
Best regards,
Jacek Ziora
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes, I am 100% sure, because I have additional repo between original repo and gerrit repo. So the flow is:original_repo (here git-svn-id is added) ----> gerrit_transfer_repo ---- < push-to-gerrit script (here Change-Id is added) > ----> Gerrit_repo
On Fri, Jun 17, 2016 at 2:44 PM, Jacek Ziora <jacek.ad...@gmail.com> wrote:git-svn-id is added automatically before the commit-msg hook runs.
Are you sure that it is also added before the commit-msg hook runs for those 2% of commits where the footers are incorrect?Maybe in case of those 2% it's run afterwards?
Forward back to main discussion.Another commit came and error occurred again. This commit doesn't differ from other commits. I will try to modify this hook, but I think it doesn't work properly.2016-06-17 15:02 GMT+02:00 Jacek Ziora <jacek.ad...@gmail.com>:Yes, I am 100% sure, because I have additional repo between original repo and gerrit repo. So the flow is:original_repo (here git-svn-id is added) ----> gerrit_transfer_repo ---- < push-to-gerrit script (here Change-Id is added) > ----> Gerrit_repo
Hmm, but then all commits from China should be broken. This situation seems to occur randomly to me...