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>
Jeff King committed
Jun 23, 2006 at 09:43 UTC
cda8ab59bbdb24b4ef87083781dac1f4f1b973a1
1 file changed
+3
-1
git-commit.sh
+3
-1
@@ -199,6 +199,7 @@ only=
199
logfile=
200
use_commit=
201
amend=
202
+edit_flag=
203
no_edit=
204
log_given=
205
log_message=
@@ -246,7 +247,7 @@ do
247
shift
248
;;
249
-e|--e|--ed|--edi|--edit)
249
- no_edit=
250
+ edit_flag=t
251
shift
252
;;
253
-i|--i|--in|--inc|--incl|--inclu|--includ|--include)
@@ -384,6 +385,7 @@ $1"
385
;;
386
esac
387
done
388
+case "$edit_flag" in t) no_edit= ;; esac
389
390
################################################################
391
# Sanity check options