From: Junio C Hamano Date: Tue, 31 May 2011 19:57:36 +0000 (-0700) Subject: post-applypatch: a bit more commenting X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24a23ec19fed2643d8272fad5f85b9b2d383592a;p=thirdparty%2Fgit.git post-applypatch: a bit more commenting ... with no functionality change. --- diff --git a/post-applypatch b/post-applypatch index dbe3e01b92..1aa18f54e5 100755 --- a/post-applypatch +++ b/post-applypatch @@ -9,11 +9,15 @@ msgnum=$(printf "%0${prec}d" $this) && test -f "$dotest/$msgnum" && message_id=$(sed -ne ' /^[ ]/{ - # Append continuation line + # Append continuation line to hold space H + # Swap hold and pattern x + # Remove the LF, making it a single line s/\n// + # Swap hold and pattern back x + # Discard the pattern and go on n } # Hold this new line, and look at what is in the hold space @@ -35,9 +39,11 @@ message_id=$(sed -ne ' q ' "$dotest/$msgnum") && -test -n "$message_id" && -head=$(git rev-parse --verify HEAD 2>/dev/null) && +if test -n "$message_id" && + head=$(git rev-parse --verify HEAD 2>/dev/null) +then + echo "$head $message_id" >>"$GIT_DIR"/am.log && + GIT_NOTES_REF=refs/notes/amlog \ + git notes add -f -m "Message-Id: $message_id" "$head" +fi -echo "$head $message_id" >>"$GIT_DIR"/am.log && -GIT_NOTES_REF=refs/notes/amlog \ - git notes add -f -m "Message-Id: $message_id" "$head"