Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = invalid committer |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 2 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 3 | For every pushed commit Gerrit verifies that the e-mail address of |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 4 | the committer matches one of the registered e-mail addresses of the |
| 5 | pushing user. If this is not the case pushing the commit fails with |
David Pursehouse | c6fd5a6 | 2012-06-26 13:42:11 +0900 | [diff] [blame] | 6 | the error message "invalid committer". This policy can be |
Fredrik Luthander | b295eea | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 7 | bypassed by having the access right |
| 8 | link:access-control.html#category_forge_committer['Forge Committer']. |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 9 | |
| 10 | This error may happen for two reasons: |
Edwin Kempin | ddfc41a | 2011-05-06 10:32:05 +0200 | [diff] [blame] | 11 | |
| 12 | . incorrect configuration of the e-mail address on client or server |
| 13 | side |
| 14 | . missing privileges to push commits that were committed by other |
| 15 | users |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 16 | |
| 17 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 18 | == Incorrect configuration of the e-mail address on client or server side |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 19 | |
David Pursehouse | c6fd5a6 | 2012-06-26 13:42:11 +0900 | [diff] [blame] | 20 | If pushing to Gerrit fails with the error message "invalid committer" |
| 21 | and you committed the change for which the push fails, |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 22 | then either you have not successfully registered this e-mail address |
| 23 | for your Gerrit account or the committer information of the pushed |
| 24 | commit is incorrect. |
| 25 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 26 | === Configuration of e-mail address in Gerrit |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 27 | |
| 28 | Check in Gerrit under 'Settings -> Identities' which e-mail addresses |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 29 | you've configured for your Gerrit account. If no e-mail address is |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 30 | registered go to 'Settings -> Contact Information' and register a new |
| 31 | e-mail address there. Make sure you confirm your e-mail address by |
| 32 | clicking on the link in the e-mail verification mail sent by Gerrit. |
| 33 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 34 | === Incorrect committer information |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 35 | |
| 36 | For every commit Git maintains the user who did the commit, the so |
| 37 | called committer. Git computes the committer out of the Git |
| 38 | configuration 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 | |
| 48 | A commit done with the above Git configuration would have |
| 49 | "John Doe <john.doe@example.com>" as committer. |
| 50 | |
| 51 | To see the committer information for existing commits do |
| 52 | "git log --format=full": |
| 53 | |
| 54 | ---- |
| 55 | $ git log --format=full |
| 56 | commit cbe31bdba7d14963eb42f7e1e0eef1fe58698c05 |
| 57 | Author: John Doe <john.doe@example.com> |
| 58 | Commit: John Doe <john.doe@example.com> |
| 59 | |
| 60 | my commit |
| 61 | |
| 62 | ---- |
| 63 | |
| 64 | Check in Git that the committer information of the commit that should |
| 65 | be pushed is correct. As explained above you can do this by |
| 66 | 'git log --format=full'. The committer should have the same e-mail |
| 67 | address that you've configured for your Gerrit account. If the |
| 68 | committer information is incorrect set the Git configuration |
| 69 | parameters 'user.name' and 'user.email' to the correct values (you |
| 70 | might want to set this globally by including the option '--global'): |
| 71 | |
| 72 | ---- |
| 73 | $ git config user.name "John Doe" |
| 74 | $ |
| 75 | $ git config user.email john.doe@example.com |
| 76 | $ |
| 77 | ---- |
| 78 | |
| 79 | Now you should rewrite the commits for which the committer |
| 80 | information is wrong. If only the last commit is affected you can do |
| 81 | this by doing a 'commit --amend'. If you need to update the committer |
| 82 | information for several commits it gets more complicated. In this |
| 83 | case you have to do an interactive git rebase for the affected |
| 84 | commits. While doing the interactive rebase you have to ensure that |
| 85 | the commits are rewritten (e.g. by choosing 'reword' for all these |
| 86 | commits and then confirming all the commit messages). Just picking |
| 87 | all the changes will not work as in this case the committer is not |
| 88 | rewritten. For further details about git rebase please check the |
| 89 | link:http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html[Git documentation]. |
| 90 | |
| 91 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 92 | == Missing privileges to push commits that were committed by other users |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 93 | |
David Pursehouse | c6fd5a6 | 2012-06-26 13:42:11 +0900 | [diff] [blame] | 94 | If pushing to Gerrit fails with the error message "invalid committer" |
| 95 | and somebody else committed the change for which the |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 96 | push fails, then you have no permissions to forge the committer |
| 97 | identity. In this case you may contact the project owner to request |
Edwin Kempin | 4053b21 | 2014-07-08 08:54:24 +0200 | [diff] [blame] | 98 | the link:access-control.html#category_forge_committer['Forge Committer'] |
| 99 | access right or ask the maintainer to commit this change on the author's |
| 100 | behalf. |
Edwin Kempin | 35d0f39 | 2010-12-21 09:26:03 +0100 | [diff] [blame] | 101 | |
| 102 | |
| 103 | GERRIT |
| 104 | ------ |
| 105 | Part of link:error-messages.html[Gerrit Error Messages] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 106 | |
| 107 | SEARCHBOX |
| 108 | --------- |