Lines Matching +full:begin +full:- +full:after +full:- +full:commit +full:- +full:hash
12 # http://www.apache.org/licenses/LICENSE-2.0
23 CHANGE_ID_AFTER="Bug|Depends-On|Issue|Test|Feature|Fixes|Fixed"
26 # Check for, and add if missing, a unique Change-Id
29 clean_message=`sed -e '
30 /^diff --git .*/{
34 /^Signed-off-by:/d
37 if test -z "$clean_message"
42 # Do not add Change-Id to temp commits
43 if echo "$clean_message" | head -1 | grep -q '^\(fixup\|squash\)!'
48 if test "false" = "`git config --bool --get gerrit.createChangeId`"
53 # Does Change-Id: already exist? if so, exit (no change).
54 if grep -i '^Change-Id:' "$MSG" >/dev/null
62 if [ -x /usr/xpg4/bin/awk ]; then
68 commentChar=`git config --get core.commentChar`
69 commentChar=${commentChar:-#}
72 # - parse the commit message as (textLine+ blankLine*)*
73 # - assume textLine+ to be a footer until proven otherwise
74 # - exception: the first block is not footer (as it is the title)
75 # - read textLine+ into a variable
76 # - then count blankLines
77 # - once the next textLine appears, print textLine+ blankLine* as these
79 # - in END, the last textLine+ block is available for footer parsing
81 BEGIN {
95 # Skip the line starting with the diff command and everything after it,
98 /^diff --git / {
111 /^\[[a-zA-Z0-9-]+:/ && (isFooter == 1) {
119 # We have a non-blank line after blank lines. Handle this.
133 (footerComment == 0) && (!/^\[?[a-zA-Z0-9-]+:/ || /^[a-zA-Z0-9-]+:\/\//) {
149 # If the last block is considered a footer, splice in the Change-Id at the
151 # Look for the right place to inject Change-Id by considering
153 # then Change-Id, then everything else (eg. Signed-off-by:).
155 # Otherwise just print the last block, a new line and the Change-Id as a
168 print "Change-Id: I'"$id"'"
173 print "Change-Id: I'"$id"'"
175 }' "$MSG" > "$T" && mv "$T" "$MSG" || rm -f "$T"
178 echo "tree `git write-tree`"
179 if parent=`git rev-parse "HEAD^0" 2>/dev/null`
190 git hash-object -t commit --stdin