My favorites
▼
|
Sign in
gerrit
Gerrit Code Review
Project Home
Downloads
Wiki
Issues
Source
Export to GitHub
New issue
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
805
attachment: 0001-Don-t-check-for-Signed-Off-By-and-Change-Id-lines-fo.patch
(3.0 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 69db3bf187fe65dfed589d58a47a1eac6c552498 Mon Sep 17 00:00:00 2001
From: James Y Knight <foom@fuhm.net>
Date: Tue, 4 Jan 2011 02:37:25 -0500
Subject: [PATCH 1/2] Don't check for Signed-Off-By and Change-Id lines for commits pushed
directly into the repository by a user with Push Branch permission.
---
.../google/gerrit/server/git/ReceiveCommits.java | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
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 d9a0089..1a4b57f 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
@@ -828,7 +828,7 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
//
continue;
}
- if (!validCommit(destBranchCtl, newChange, c)) {
+ if (!validCommit(destBranchCtl, newChange, c, true)) {
// Not a change the user can propose? Abort as early as possible.
//
return;
@@ -1066,7 +1066,7 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
reject(request.cmd, "cannot replace " + request.ontoChange);
return null;
}
- if (!validCommit(changeCtl.getRefControl(), request.cmd, c)) {
+ if (!validCommit(changeCtl.getRefControl(), request.cmd, c, true)) {
return null;
}
@@ -1424,7 +1424,7 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
RevCommit c;
while ((c = walk.next()) != null) {
- if (!validCommit(ctl, cmd, c)) {
+ if (!validCommit(ctl, cmd, c, false)) {
break;
}
}
@@ -1446,7 +1446,7 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
}
private boolean validCommit(final RefControl ctl, final ReceiveCommand cmd,
- final RevCommit c) throws MissingObjectException, IOException {
+ final RevCommit c, boolean check_cid) throws MissingObjectException, IOException {
rp.getRevWalk().parseBody(c);
final PersonIdent committer = c.getCommitterIdent();
final PersonIdent author = c.getAuthorIdent();
@@ -1479,7 +1479,7 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
return false;
}
- if (project.isUseSignedOffBy()) {
+ if (project.isUseSignedOffBy() && check_cid) {
// If the project wants Signed-off-by / Acked-by lines, verify we
// have them for the blamable parties involved on this change.
//
@@ -1500,7 +1500,7 @@ public class ReceiveCommits implements PreReceiveHook, PostReceiveHook {
}
}
- if (project.isRequireChangeID()) {
+ if (project.isRequireChangeID() && check_cid) {
final List<String> idList = c.getFooterLines(CHANGE_ID);
if (idList.isEmpty()) {
reject(cmd, "missing Change-Id in commit message ");
--
1.7.2.3
Powered by
Google Project Hosting