Re: [PATCH, properly formatted] git-commit: add a --interactive option
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 5, 2007, 08:54 UTC
- Message-ID
- <7v4pp0136d.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <45EBCD81.8020605@lu.unisi.ch>
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:
> ... Since > interactive stuff does not require backward compatibility in general, > I would ask to commit my patch anyway, assuming that in the future the > feature is rewritten to conform to the flow you indicate...
I think people feel changes to interactive workflow is a big deal.
Show 17 quoted lines
> diff --git a/git-commit.sh b/git-commit.sh > index be3677c..e8ec3b9 100755 > --- a/git-commit.sh > +++ b/git-commit.sh > ... > esac > unset only > +case "$all,$interactive,$also,$#" in > +*t,*t,*) > + die "Cannot use -a, --interactive or -i at the same time." ;; > t,,[1-9]*) > die "Paths with -a does not make sense." ;; > +,t,[1-9]*) > + die "Paths with --interactive does not make sense." ;; > +,,t,0) > die "No paths with -i does not make sense." ;; > esac
Clever.
Show 10 quoted lines
> @@ -344,6 +352,9 @@ t,) > ) || exit > ;; > ,) > + if test "$interactive" = t; then > + git add --interactive || exit > + fi > case "$#" in > 0) > ;; # commit as-is
If we were to do this, we probably would want a way to exit non-zero from "git-add -i", but I guess we can say we already have that way via ^C.
Will queue for 'next', but it's getting late here so it probably would not appear on the public repository tonight.
Thanks.