From: Junio C Hamano Date: Sat, 19 Apr 2008 07:25:15 +0000 (-0700) Subject: Merge branch 'jc/maint-rebase-am' X-Git-Tag: v1.5.6-rc0~141 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8876046037a3064f906d2155ea30cb6db186e409?ds=inline;hp=-c Merge branch 'jc/maint-rebase-am' * jc/maint-rebase-am: rebase: do not munge commit log message Conflicts: git-am.sh --- 8876046037a3064f906d2155ea30cb6db186e409 diff --combined git-am.sh index a391254a70,5a7695efae..75886a8f2f --- a/git-am.sh +++ b/git-am.sh @@@ -327,11 -327,20 +327,20 @@@ d echo "Patch is empty. Was it split wrong?" stop_here $this } - SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" - case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac - - (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | - git stripspace > "$dotest/msg-clean" + if test -f "$dotest/rebasing" && + commit=$(sed -e 's/^From \([0-9a-f]*\) .*/\1/' \ + -e q "$dotest/$msgnum") && + test "$(git cat-file -t "$commit")" = commit + then + git cat-file commit "$commit" | + sed -e '1,/^$/d' >"$dotest/msg-clean" + else + SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" + case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac + - (echo "$SUBJECT" ; echo ; cat "$dotest/msg") | ++ (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | + git stripspace > "$dotest/msg-clean" + fi ;; esac @@@ -383,6 -392,7 +392,6 @@@ ;; esac esac - FIRSTLINE=$(head -1 "$dotest/final-commit") resume= if test "$interactive" = t @@@ -403,6 -413,7 +412,6 @@@ [aA]*) action=yes interactive= ;; [nN]*) action=skip ;; [eE]*) git_editor "$dotest/final-commit" - FIRSTLINE=$(head -1 "$dotest/final-commit") action=again ;; [vV]*) action=again LESS=-S ${PAGER:-less} "$dotest/patch" ;; @@@ -412,7 -423,6 +421,7 @@@ else action=yes fi + FIRSTLINE=$(head -1 "$dotest/final-commit") if test $action = skip then