Git development
 help / color / mirror / Atom feed
* [PATCH] git-commit: allow -e option anywhere on command line
@ 2006-06-23 13:43 Jeff King
  2006-06-23 23:56 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff King @ 2006-06-23 13:43 UTC (permalink / raw)
  To: junkio; +Cc: git

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>
---
 git-commit.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/git-commit.sh b/git-commit.sh
index 6dd04fd..4bb16db 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 @@ do
       ;;
   esac
 done
+case "$edit_flag" in t) no_edit= ;; esac 
 
 ################################################################
 # Sanity check options
-- 
1.4.1.rc1.gf603-dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-23 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-23 13:43 [PATCH] git-commit: allow -e option anywhere on command line Jeff King
2006-06-23 23:56 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox