Kaynağa Gözat

Update Gerrit commit hook.

pull/4/head
Greg Holmes 9 yıl önce
ebeveyn
işleme
8077feb166
1 değiştirilmiş dosya ile 9 ekleme ve 2 silme
  1. 9
    2
      etc/gerrit/commit-msg

+ 9
- 2
etc/gerrit/commit-msg Dosyayı Görüntüle

1
 #!/bin/sh
1
 #!/bin/sh
2
-# From Gerrit Code Review 2.4.2
2
+# From Gerrit Code Review 2.8.1
3
 #
3
 #
4
 # Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
4
 # Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
5
 #
5
 #
18
 # limitations under the License.
18
 # limitations under the License.
19
 #
19
 #
20
 
20
 
21
+unset GREP_OPTIONS
22
+
21
 CHANGE_ID_AFTER="Bug|Issue"
23
 CHANGE_ID_AFTER="Bug|Issue"
22
 MSG="$1"
24
 MSG="$1"
23
 
25
 
37
 		return
39
 		return
38
 	fi
40
 	fi
39
 
41
 
42
+	if test "false" = "`git config --bool --get gerrit.createChangeId`"
43
+	then
44
+		return
45
+	fi
46
+
40
 	# Does Change-Id: already exist? if so, exit (no change).
47
 	# Does Change-Id: already exist? if so, exit (no change).
41
 	if grep -i '^Change-Id:' "$MSG" >/dev/null
48
 	if grep -i '^Change-Id:' "$MSG" >/dev/null
42
 	then
49
 	then
152
 		if (unprinted) {
159
 		if (unprinted) {
153
 			print "Change-Id: I'"$id"'"
160
 			print "Change-Id: I'"$id"'"
154
 		}
161
 		}
155
-	}' "$MSG" > $T && mv $T "$MSG" || rm -f $T
162
+	}' "$MSG" > "$T" && mv "$T" "$MSG" || rm -f "$T"
156
 }
163
 }
157
 _gen_ChangeIdInput() {
164
 _gen_ChangeIdInput() {
158
 	echo "tree `git write-tree`"
165
 	echo "tree `git write-tree`"

Loading…
İptal
Kaydet