blob: 5808d4f8febb6522b5b63c9ab9b29bc33b065843 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= invalid author
Edwin Kempin9b34e352010-12-23 07:36:31 +01002
David Pursehouse221d4f62012-06-08 17:38:08 +09003For every pushed commit Gerrit verifies that the e-mail address of
Edwin Kempin9b34e352010-12-23 07:36:31 +01004the author matches one of the registered e-mail addresses of the
5pushing user. If this is not the case pushing the commit fails with
David Pursehousec6fd5a62012-06-26 13:42:11 +09006the error message "invalid author". This policy can be
Fredrik Luthanderb295eea2011-12-27 13:40:43 +01007bypassed by having the access right
8link:access-control.html#category_forge_author['Forge Author'].
Edwin Kempin9b34e352010-12-23 07:36:31 +01009
10This error may happen for two reasons:
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +010011
12. incorrect configuration of the e-mail address on client or server side
13. missing privileges to push commits of other authors
Edwin Kempin9b34e352010-12-23 07:36:31 +010014
15
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080016== Incorrect configuration of the e-mail address on client or server side
Edwin Kempin9b34e352010-12-23 07:36:31 +010017
David Pursehousec6fd5a62012-06-26 13:42:11 +090018If pushing to Gerrit fails with the error message "invalid author"
19and you are the author of the commit for which the push
Edwin Kempin9b34e352010-12-23 07:36:31 +010020fails, then either you have not successfully registered this e-mail
21address for your Gerrit account or the author information of the
22pushed commit is incorrect.
23
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080024=== Configuration of e-mail address in Gerrit
Edwin Kempin9b34e352010-12-23 07:36:31 +010025
26Check in Gerrit under 'Settings -> Identities' which e-mail addresses
David Pursehouse221d4f62012-06-08 17:38:08 +090027you've configured for your Gerrit account. If no e-mail address is
Edwin Kempin9b34e352010-12-23 07:36:31 +010028registered go to 'Settings -> Contact Information' and register a new
29e-mail address there. Make sure you confirm your e-mail address by
30clicking on the link in the e-mail verification mail sent by Gerrit.
31If you don't receive the e-mail verification mail it might be that it
32was caught by your spam filter.
33
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080034=== Incorrect author information
Edwin Kempin9b34e352010-12-23 07:36:31 +010035
36For every commit Git maintains the author. If not explicitly
37specified Git computes the author on commit out of the Git
38configuration parameters 'user.name' and 'user.email'.
39
40----
41 $ git config -l
42 ...
43 user.name=John Doe
44 user.email=john.doe@example.com
45 ...
46----
47
48A commit done with the above Git configuration would have
49"John Doe <john.doe@example.com>" as author.
50
51You can see the author information for existing commits in the
52history.
53
54----
55 $ git log
56 commit cbe31bdba7d14963eb42f7e1e0eef1fe58698c05
57 Author: John Doe <john.doe@example.com>
58 Date: Mon Dec 20 15:36:33 2010 +0100
59
60 my commit
61
62----
63
64Check in Git that the author information of the commit that should
65be pushed is correct. The author should have the same e-mail address
66that you've configured for your Gerrit account. If the author
67information is incorrect set the Git configuration parameters
68'user.name' and 'user.email' to the correct values (you might want to
69set this globally by including the option '--global'):
70
71----
72 $ git config user.name "John Doe"
73 $
74 $ git config user.email john.doe@example.com
75 $
76----
77
78Now you should update the author for those commits where the author
79information is wrong. If only the last commit is affected you can do
80this by amending the last commit and explicitly setting the author:
81
82----
83 $ git commit --amend --author "John Doe <john.doe@example.com>"
84----
85
86If you need to update the author information for several commits it
87gets more complicated. In this case you have to do an interactive
88git rebase for the affected commits. While doing the interactive
89rebase you have to choose 'edit' for those commits for which the
90author should be rewritten. When the rebase stops at such a commit
David Pursehouse221d4f62012-06-08 17:38:08 +090091you have to amend the commit, explicitly setting the author
Edwin Kempin9b34e352010-12-23 07:36:31 +010092before continuing the rebase.
93
Shawn O. Pearce392ef852011-10-11 10:50:36 -070094Here is an example that shows how the interactive rebase is used to
Edwin Kempin9b34e352010-12-23 07:36:31 +010095update the author for the last 3 commits:
96
97----
98 $ git rebase -i HEAD~3
99
100 edit 51f0d47 one commit
101 edit 7299690 another commit
102 edit 304ad96 one more commit
103
104 Stopped at 51f0d47... one commit
105 You can amend the commit now, with
106
107 git commit --amend
108
109 Once you are satisfied with your changes, run
110
111 git rebase --continue
112
113 $ git commit --amend --author "John Doe <john.doe@example.com>"
114 [detached HEAD baea1e4] one commit
115 Author: John Doe <john.doe@example.com>
116 1 files changed, 4 insertions(+), 1 deletions(-)
117
118 $ git rebase --continue
119
120 ...
121----
122
123For further details about git rebase please check the
124link:http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html[Git documentation].
125
126
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800127== Missing privileges to push commits of other users
Edwin Kempin9b34e352010-12-23 07:36:31 +0100128
David Pursehousec6fd5a62012-06-26 13:42:11 +0900129If pushing to Gerrit fails with the error message "invalid author"
130and somebody else is author of the commit for which the
Edwin Kempin9b34e352010-12-23 07:36:31 +0100131push fails, then you have no permissions to forge the author
132identity. In this case you may contact the project owner to request
133the access right '+1 Forge Author Identity' in the 'Forge Identity'
134category or ask the maintainer to commit this change on the author's
135behalf.
136
137
138GERRIT
139------
140Part of link:error-messages.html[Gerrit Error Messages]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700141
142SEARCHBOX
143---------