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

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.
Previous: Paolo Bonzini
Message 2 of 2 in “git-commit: add a --interactive option”
  1. git-commit: add a --interactive optionPaolo Bonzini, Mar 5, 2007
  2. Junio C HamanoMar 5, 2007

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.