post-applypatch: a bit more commenting
... with no functionality change.
Junio C Hamano committed
May 31, 2011 at 12:57 UTC
24a23ec19fed2643d8272fad5f85b9b2d383592a
1 file changed
+12
-6
post-applypatch
+12
-6
@@ -9,11 +9,15 @@ msgnum=$(printf "%0${prec}d" $this) &&
9
test -f "$dotest/$msgnum" &&
10
message_id=$(sed -ne '
11
/^[ ]/{
12
- # Append continuation line
12
+ # Append continuation line to hold space
13
H
14
+ # Swap hold and pattern
15
x
16
+ # Remove the LF, making it a single line
17
s/\n//
18
+ # Swap hold and pattern back
19
x
20
+ # Discard the pattern and go on
21
n
22
}
23
# Hold this new line, and look at what is in the hold space
@@ -35,9 +39,11 @@ message_id=$(sed -ne '
39
q
40
' "$dotest/$msgnum") &&
41
38
-test -n "$message_id" &&
39
-head=$(git rev-parse --verify HEAD 2>/dev/null) &&
42
+if test -n "$message_id" &&
43
+ head=$(git rev-parse --verify HEAD 2>/dev/null)
44
+then
45
+ echo "$head $message_id" >>"$GIT_DIR"/am.log &&
46
+ GIT_NOTES_REF=refs/notes/amlog \
47
+ git notes add -f -m "Message-Id: $message_id" "$head"
48
+fi
49
41
-echo "$head $message_id" >>"$GIT_DIR"/am.log &&
42
-GIT_NOTES_REF=refs/notes/amlog \
43
- git notes add -f -m "Message-Id: $message_id" "$head"