blob: c06eba27833f6f22158a0a1d7cbb8e5a42abe267 [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= invalid committer
Edwin Kempin35d0f392010-12-21 09:26:03 +01003
David Pursehouse221d4f62012-06-08 17:38:08 +09004For every pushed commit Gerrit verifies that the e-mail address of
Edwin Kempin35d0f392010-12-21 09:26:03 +01005the committer matches one of the registered e-mail addresses of the
6pushing user. If this is not the case pushing the commit fails with
David Pursehousec6fd5a62012-06-26 13:42:11 +09007the error message "invalid committer". This policy can be
Fredrik Luthanderb295eea2011-12-27 13:40:43 +01008bypassed by having the access right
9link:access-control.html#category_forge_committer['Forge Committer'].
Edwin Kempin35d0f392010-12-21 09:26:03 +010010
11This error may happen for two reasons:
Edwin Kempinddfc41a2011-05-06 10:32:05 +020012
13. incorrect configuration of the e-mail address on client or server
14 side
15. missing privileges to push commits that were committed by other
16 users
Edwin Kempin35d0f392010-12-21 09:26:03 +010017
18
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080019== Incorrect configuration of the e-mail address on client or server side
Edwin Kempin35d0f392010-12-21 09:26:03 +010020
David Pursehousec6fd5a62012-06-26 13:42:11 +090021If pushing to Gerrit fails with the error message "invalid committer"
22and you committed the change for which the push fails,
Edwin Kempin35d0f392010-12-21 09:26:03 +010023then either you have not successfully registered this e-mail address
24for your Gerrit account or the committer information of the pushed
25commit is incorrect.
26
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080027=== Configuration of e-mail address in Gerrit
Edwin Kempin35d0f392010-12-21 09:26:03 +010028
29Check in Gerrit under 'Settings -> Identities' which e-mail addresses
David Pursehouse221d4f62012-06-08 17:38:08 +090030you've configured for your Gerrit account. If no e-mail address is
Edwin Kempin35d0f392010-12-21 09:26:03 +010031registered go to 'Settings -> Contact Information' and register a new
32e-mail address there. Make sure you confirm your e-mail address by
33clicking on the link in the e-mail verification mail sent by Gerrit.
34
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080035=== Incorrect committer information
Edwin Kempin35d0f392010-12-21 09:26:03 +010036
37For every commit Git maintains the user who did the commit, the so
38called committer. Git computes the committer out of the Git
39configuration parameters 'user.name' and 'user.email'.
40
41----
42 $ git config -l
43 ...
44 user.name=John Doe
45 user.email=john.doe@example.com
46 ...
47----
48
49A commit done with the above Git configuration would have
50"John Doe <john.doe@example.com>" as committer.
51
52To see the committer information for existing commits do
53"git log --format=full":
54
55----
56 $ git log --format=full
57 commit cbe31bdba7d14963eb42f7e1e0eef1fe58698c05
58 Author: John Doe <john.doe@example.com>
59 Commit: John Doe <john.doe@example.com>
60
61 my commit
62
63----
64
65Check in Git that the committer information of the commit that should
66be pushed is correct. As explained above you can do this by
67'git log --format=full'. The committer should have the same e-mail
68address that you've configured for your Gerrit account. If the
69committer information is incorrect set the Git configuration
70parameters 'user.name' and 'user.email' to the correct values (you
71might want to set this globally by including the option '--global'):
72
73----
74 $ git config user.name "John Doe"
75 $
76 $ git config user.email john.doe@example.com
77 $
78----
79
80Now you should rewrite the commits for which the committer
81information is wrong. If only the last commit is affected you can do
82this by doing a 'commit --amend'. If you need to update the committer
83information for several commits it gets more complicated. In this
84case you have to do an interactive git rebase for the affected
85commits. While doing the interactive rebase you have to ensure that
86the commits are rewritten (e.g. by choosing 'reword' for all these
87commits and then confirming all the commit messages). Just picking
88all the changes will not work as in this case the committer is not
89rewritten. For further details about git rebase please check the
Marian Harbach34253372019-12-10 18:01:31 +010090link:http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html[Git documentation,role=external,window=_blank].
Edwin Kempin35d0f392010-12-21 09:26:03 +010091
92
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080093== Missing privileges to push commits that were committed by other users
Edwin Kempin35d0f392010-12-21 09:26:03 +010094
David Pursehousec6fd5a62012-06-26 13:42:11 +090095If pushing to Gerrit fails with the error message "invalid committer"
96and somebody else committed the change for which the
Edwin Kempin35d0f392010-12-21 09:26:03 +010097push fails, then you have no permissions to forge the committer
98identity. In this case you may contact the project owner to request
Edwin Kempin4053b212014-07-08 08:54:24 +020099the link:access-control.html#category_forge_committer['Forge Committer']
100access right or ask the maintainer to commit this change on the author's
101behalf.
Edwin Kempin35d0f392010-12-21 09:26:03 +0100102
103
104GERRIT
105------
106Part of link:error-messages.html[Gerrit Error Messages]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700107
108SEARCHBOX
109---------