Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: junkio@cox.net
Cc: git@vger.kernel.org
Subject: [PATCH] git-commit: allow -e option anywhere on command line
Date: Fri, 23 Jun 2006 09:43:38 -0400	[thread overview]
Message-ID: <20060623134338.GA12630@coredump.intra.peff.net> (raw)

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

             reply	other threads:[~2006-06-23 13:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23 13:43 Jeff King [this message]
2006-06-23 23:56 ` [PATCH] git-commit: allow -e option anywhere on command line Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060623134338.GA12630@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox