summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Kempin <edwin.kempin@sap.com>2013-01-23 09:08:40 +0100
committerEdwin Kempin <edwin.kempin@sap.com>2013-02-01 13:39:51 +0100
commite0920c711d693ece5241d808bc060173fa92aec1 (patch)
tree89b82b296bd8d8276fb81e9a769a5ac394bc1873
parentc13a9baeb16d69d51d252ea6f7916f5b512aaa61 (diff)
Remove wrong error message if pushing a new ref fails
If pushing a new ref is rejected because the user is not allowed to create it the error message always told the user that he's missing the 'Create Reference' access right. This is not true in all cases, users may have the 'Create Reference' access right assigned and still they are not allowed to create the ref: - pushing an annotated tag requires the 'Push Annotated Tag' access right - pushing a signed tag requires the 'Push Signed Tag' access right - the project state may be set to 'Read Only' It is better to have a generic error message that is described in the documentation than having a more concrete error message that is wrong in some cases. A wrong error message misleads and confuses the user. Updating the description of the 'Prohibited by Gerrit' error in the documentation to explain some additional cases in which this error occurs. Bug: issue 1767 Change-Id: I45470256107198ae9208ccc375a6ec8d0c4f6e1d Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
-rw-r--r--Documentation/error-prohibited-by-gerrit.txt8
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java5
2 files changed, 7 insertions, 6 deletions
diff --git a/Documentation/error-prohibited-by-gerrit.txt b/Documentation/error-prohibited-by-gerrit.txt
index 56e585168e..bad2b3c060 100644
--- a/Documentation/error-prohibited-by-gerrit.txt
+++ b/Documentation/error-prohibited-by-gerrit.txt
@@ -17,11 +17,15 @@ In particular this error occurs:
3. if you push an annotated tag without
link:access-control.html#category_push_annotated['Push Annotated Tag']
access right on 'refs/tags/*'
-4. if you push a lightweight tag without the access right link:access-control.html#category_create['Create
+4. if you push a signed tag without
+ link:access-control.html#category_push_signed['Push Signed Tag']
+ access right on 'refs/tags/*'
+5. if you push a lightweight tag without the access right link:access-control.html#category_create['Create
Reference'] for the reference name 'refs/tags/*'
-5. if you push a tag with somebody else as tagger and you don't have the
+6. if you push a tag with somebody else as tagger and you don't have the
link:access-control.html#category_forge_committer['Forge Committer']
access right for the reference name 'refs/tags/*'
+7. if you push to a project that is in state 'Read Only'
For new users it often happens that they accidentally try to bypass
code review. The push then fails with the error message 'prohibited
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java
index a3a6ac154a..a2a809bc06 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java
@@ -139,9 +139,7 @@ public class ReceiveCommits {
DELETE("You need 'Push' rights with the 'Force Push'\n"
+ "flag set to delete references."),
CODE_REVIEW("You need 'Push' rights to upload code review requests.\n"
- + "Verify that you are pushing to the right branch."),
- CREATE("You are not allowed to perform this operation.\n"
- + "To create new references you need 'Create Reference' rights.");
+ + "Verify that you are pushing to the right branch.");
private final String value;
@@ -831,7 +829,6 @@ public class ReceiveCommits {
validateNewCommits(ctl, cmd);
batch.addCommand(cmd);
} else {
- errors.put(Error.CREATE, ctl.getRefName());
reject(cmd);
}
}