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

Re: [PATCH] Use a temporary index for interactive git-commit

From
Jeff King <peff@peff.net>
Date
Dec 30, 2010, 04:33 UTC
Message-ID
<20101230043355.GA24555@sigill.intra.peff.net>
In-Reply-To
<1293670038-8606-1-git-send-email-conrad.irwin@gmail.com>
On Thu, Dec 30, 2010 at 12:47:18AM +0000, Conrad Irwin wrote:
> Hitherto even an aborted git commit -p or git commit --interactive has
> added the selected changes to the index.

Hmm. I see how it could be confusing if you do ^C in "git commit -p" and it actually commits what you had staged. But if I am reading the patch right here:

Show 9 quoted lines
> --- a/builtin/add.c
> +++ b/builtin/add.c
> @@ -378,7 +386,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
>  	if (patch_interactive)
>  		add_interactive = 1;
>  	if (add_interactive)
> -		exit(interactive_add(argc - 1, argv + 1, prefix, patch_interactive));
> +		exit(interactive_add(argc - 1, argv + 1, prefix, patch_interactive, NULL));
>  

this behavior will not apply to "git add -p". So doesn't that introduce a new confusing inconsistency, that ^C from "git commit -p" abandons changes entirely, but from "git add -p" will silently stage changes?

-Peff
Previous: Jonathan NiederNext: Conrad Irwin
Message 3 of 4 in “Use a temporary index for interactive git-commit”
  1. Use a temporary index for interactive git-commitConrad Irwin, Dec 30, 2010
  2. Jonathan NiederDec 30, 2010
  3. Jeff KingDec 30, 2010
  4. Conrad IrwinDec 30, 2010

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.