ERROR: missing Change-Id in commit message footer

4,263 views
Skip to first unread message

Kristina Chodorow

unread,
Jul 22, 2015, 12:32:31 AM7/22/15
to Repo and Gerrit Discussion
I'm getting the error above, but my commit has a change id:

$ git log -1
commit d11e449eca8d79fe26abda44dba39c75d6d56b7c
Author: Kristina Chodorow <k.cho...@gmail.com>
Date:   Tue Jul 21 16:44:50 2015 -0400

    Add dylib as a C++ file type
    
    Change-Id: I5b7def4a74bec9cb6d8765bb60f23a3de76a35a0
$ git push https://bazel.googlesource.com/bazel HEAD:refs/for/master
Counting objects: 315, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (178/178), done.
Writing objects: 100% (315/315), 108.16 KiB | 0 bytes/s, done.
Total 315 (delta 181), reused 212 (delta 91)
remote: Resolving deltas: 100% (181/181)
remote: Processing changes: refs: 1, done    
remote: ERROR: missing Change-Id in commit message footer
remote: 
remote: Hint: To automatically insert Change-Id, install the hook:
remote: curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x `git rev-parse --git-dir`/hooks/commit-msg
remote: And then amend the commit:
remote:   git commit --amend
remote: 
 ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
error: failed to push some refs to 'https://bazel.googlesource.com/bazel'

I've installed the hook and tried regenerating the Change-Id (clearing it in the --amend and making the hook rewrite it).  Any ideas how to fix?

Edwin Kempin

unread,
Jul 22, 2015, 1:27:15 AM7/22/15
to Kristina Chodorow, Repo and Gerrit Discussion
Likely your push command is trying to push more than just the latest commit. Can it be that commit d11e449eca8d79fe26abda44dba39c75d6d56b7c has predecessor commits without Change-Id. If yes, you can use interactive rebase to rewrite them with a Change-Id.

--
--
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.

Saša Živkov

unread,
Jul 22, 2015, 10:23:39 AM7/22/15
to Kristina Chodorow, Repo and Gerrit Discussion
On Tue, Jul 21, 2015 at 10:57 PM, Kristina Chodorow <kcho...@google.com> wrote:
I'm getting the error above, but my commit has a change id:

$ git log -1

Try instead:

$ git log origin/master..

and it will show you all commits which will get pushed with your push command.
All of these commits must have the Change-Id in their commit message.
 

--

Kristina Chodorow

unread,
Jul 22, 2015, 10:54:06 AM7/22/15
to Saša Živkov, Repo and Gerrit Discussion
Okay, I had something weird going on with branches/remotes/whatnot.  Thanks for the advice!  For future ref, I did:

$ git fetch gerrit
$ git reset --hard gerrit/master
$ git cherry-pick d1870eb9b2a1f5a77785d8e780962536fcddf02f
$ git log gerrit/master..bazel-1
commit 58f729dd401021df136887ac935008118b72f369
Author: Kristina Chodorow <k.cho...@gmail.com>
Date:   Tue Jul 21 16:44:50 2015 -0400

    Add dylib as a C++ file type
    
    Change-Id: I5b7def4a74bec9cb6d8765bb60f23a3de76a35a0
$ git push gerrit HEAD:refs/for/master

...and it worked.
Reply all
Reply to author
Forward
0 new messages