git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-commit: allow -e option anywhere on command line

From
Jeff King <peff@peff.net>
Date
Jun 23, 2006, 13:43 UTC
Message-ID
<20060623134338.GA12630@coredump.intra.peff.net>

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
Next: Junio C Hamano
Message 1 of 2 in “git-commit: allow -e option anywhere on command line”
  1. git-commit: allow -e option anywhere on command lineJeff King, Jun 23, 2006
  2. Junio C HamanoJun 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.