On Thursday, January 24, 2013 at 15:57 EST,
Skip Montanaro <
skip.mo...@gmail.com> wrote:
> I'm a new Gerrit user (hopefully this is the right place to ask
> questions - if not, please point me in the right direction),
You've come to the right place.
> trying to perform my first push. I'm sure I've made some elementary
> mistake, but I can't figure out what's wrong. On my first attempt it
> complained about missing Change-Id and suggested I copy the commit-msg
> hook from the server. Did that. Checked that it was executable.
> Now, how to create a commit with a Change-Id?
The hook adds it to new commits as well as amended ones.
> I figured that with the new commit hook in place, future commits would
> have a Change-Id, so I figured out how to use the git rebase command
> (did I mention I'm also a new Git user?) and collapsed all my commits
> into one. Then I tried the push again. Same error. I did see a
> Change-Id scroll by in the output though:
>
> % git push gerrit:... HEAD:refs/for/...
> Counting objects: 34, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (17/17), done.
> Writing objects: 100% (18/18), 1.65 KiB, done.
> Total 18 (delta 16), reused 0 (delta 0)
> remote: Resolving deltas: 100% (16/16)
> remote: Processing changes: refs: 1, done
> remote: ERROR: missing Change-Id in commit message footer
> remote: Suggestion for commit message:
> ...
> remote:
> remote: Change-Id: Ic8d0353b9df761ba80c0896c0a2b555dd323de56
> remote:
> remote: Hint: To automatically insert Change-Id, install the hook:
> ...
>
> So, why is Gerrit suggesting a Change-Id? Wasn't the commit-msg hook
> supposed to add it automatically? How do I get this suggested
> Change-Id into the commit message?
What is the commit message of the commit you're trying to push (use
"git log -1" as Martin suggested)? Feel free to s/[A-Za-z]/x/g if the
message contains confidential information. The hook should've added
the line, but without seeing the evidence there's not much point
speculating what's wrong.
I will say that Gerrit is picky about the Change-Id line being in the
last paragraph. Make sure it is.
--
Magnus Bäck
ba...@google.com