Skip to content

Commit

Permalink
git-commit: allow -e option anywhere on command line
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 23, 2006
1 parent 8d3cbd2 commit cda8ab5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ only=
logfile=
use_commit=
amend=
edit_flag=
no_edit=
log_given=
log_message=
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -384,6 +385,7 @@ $1"
;;
esac
done
case "$edit_flag" in t) no_edit= ;; esac

################################################################
# Sanity check options
Expand Down

0 comments on commit cda8ab5

Please sign in to comment.