X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-am.sh;h=4838cdb9ede8765b37ab663aa59fb1b011a30b4c;hb=61ed71dcff8448b0700ef032aa1f962649306624;hp=96869a24530be7c560048261da135e89556842f2;hpb=d718c19bc686a15ed69cd7631e50613dd4901e03;p=git.git diff --git a/git-am.sh b/git-am.sh index 96869a245..4838cdb9e 100755 --- a/git-am.sh +++ b/git-am.sh @@ -205,7 +205,7 @@ check_patch_format () { # and see if it looks like that they all begin with the # header field names... sed -n -e '/^$/q' -e '/^[ ]/d' -e p "$1" | - LC_ALL=C egrep -v '^[!-9;-~]+:' >/dev/null || + sane_egrep -v '^[!-9;-~]+:' >/dev/null || patch_format=mbox fi } < "$1" || clean_abort @@ -561,7 +561,7 @@ do stop_here $this # skip pine's internal folder data - grep '^Author: Mail System Internal Data$' \ + sane_grep '^Author: Mail System Internal Data$' \ <"$dotest"/info >/dev/null && go_next && continue @@ -577,11 +577,12 @@ do 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 - - (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | - git stripspace > "$dotest/msg-clean" + { + sed -n '/^Subject/ s/Subject: //p' "$dotest/info" + echo + cat "$dotest/msg" + } | + git stripspace > "$dotest/msg-clean" fi ;; esac @@ -656,7 +657,10 @@ do [eE]*) git_editor "$dotest/final-commit" action=again ;; [vV]*) action=again - LESS=-S ${PAGER:-less} "$dotest/patch" ;; + : ${GIT_PAGER=$(git var GIT_PAGER)} + : ${LESS=-FRSX} + export LESS + $GIT_PAGER "$dotest/patch" ;; *) action=again ;; esac done