summaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2006-06-23 09:43:38 -0400
committerJunio C Hamano <junkio@cox.net>2006-06-23 16:55:51 -0700
commitcda8ab59bbdb24b4ef87083781dac1f4f1b973a1 (patch)
treee824785f5b7ace7d2ae1d69819be2a6678922d14 /git-commit.sh
parent8d3cbd27d46bdf42d632de0a2e7f048855941128 (diff)
downloadgit-cda8ab59bbdb24b4ef87083781dac1f4f1b973a1.tar.gz
git-commit: allow -e option anywhere on command line
Previously, the command 'git-commit -e -m foo' would ignore the '-e' option because the '-m' option overwrites the no_edit flag during sequential option parsing. Now we cause -e to reset the no_edit flag after all options are parsed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-xgit-commit.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-commit.sh b/git-commit.sh
index 6dd04fd367..e74fe640b8 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -199,6 +199,7 @@ only=
logfile=
use_commit=
amend=
+edit_flag=
no_edit=
log_given=
log_message=
@@ -246,7 +247,7 @@ do
shift
;;
-e|--e|--ed|--edi|--edit)
- no_edit=
+ edit_flag=t
shift
;;
-i|--i|--in|--inc|--incl|--inclu|--includ|--include)
@@ -384,6 +385,7 @@ $1"
;;
esac
done
+case "$edit_flag" in t) no_edit= ;; esac
################################################################
# Sanity check options