X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-revert.sh;h=c1aebb159cab86f419ff2aaab2a8f1d9d79a9a72;hb=3e9fabc85ef44fa0f275dd89738a2dacb7b6f5db;hp=dfd914cf561c10f92ef2f3207446800de70c4834;hpb=e2f5f6ef6795c880a2f13ea472b96704b4a4ca94;p=git.git diff --git a/git-revert.sh b/git-revert.sh index dfd914cf..c1aebb15 100755 --- a/git-revert.sh +++ b/git-revert.sh @@ -3,15 +3,17 @@ # Copyright (c) 2005 Linus Torvalds # Copyright (c) 2005 Junio C Hamano # -. git-sh-setup || die "Not a git archive" +. git-sh-setup case "$0" in *-revert* ) + test -t 0 && edit=-e me=revert ;; *-cherry-pick* ) + edit= me=cherry-pick ;; * ) - die "What are ou talking about?" ;; + die "What are you talking about?" ;; esac usage () { @@ -33,6 +35,12 @@ do --no-commi|--no-commit) no_commit=t ;; + -e|--e|--ed|--edi|--edit) + edit=-e + ;; + -n|--n|--no|--no-|--no-e|--no-ed|--no-edi|--no-edit) + edit= + ;; -r|--r|--re|--rep|--repl|--repla|--replay) replay=t ;; @@ -112,7 +120,7 @@ cherry-pick) q }' set_author_env=`git-cat-file commit "$commit" | - sed -ne "$pick_author_script"` + LANG=C LC_ALL=C sed -ne "$pick_author_script"` eval "$set_author_env" export GIT_AUTHOR_NAME export GIT_AUTHOR_EMAIL @@ -163,7 +171,7 @@ echo >&2 "Finished one $me." case "$no_commit" in '') - git-commit -n -F .msg + git-commit -n -F .msg $edit rm -f .msg ;; esac