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

Re: [PATCH] Teach git-stash to "apply --index"

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 3, 2007, 04:33 UTC
Message-ID
<7vodiut8c3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0707021213350.4438@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 6 quoted lines
> 	I am not quite sure if this should not be the default, with
> 	--skip-index to turn it off if the trivial index merge fails,
> 	and the user might be interested only in the working directory
> 	changes anyway.
>
> 	Comments?

There is a bit of impedance mismatch between a rename-aware three-way merge (aka merge-recursive) used to update the working tree and a patch that updates the index. The "rename-aware" thing can be fixed by doing the diff with -M, though.

It might be easier to explain (1) not have --index option, but attempt to do this always, and (2) even if the index cannot be updated, keep going, without worrying about losing the difference between I and W, probably with a message to the end user.

Suppose you are the user who gets "perhaps you would want to run without --index?" hint. What can you do? Run without --index, or forget about unstashing. But the latter does not sound like an option. So it feels to me that --index is an unnecessary option.

The potential confusion problem I mentioned in two of my earlier messages due to the program doing one thing sometimes and another thing some other times still applies, though.

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 2 of 3 in “Teach git-stash to "apply --index"”
  1. Teach git-stash to "apply --index"Johannes Schindelin, Jul 2, 2007
  2. Junio C HamanoJul 3, 2007
  3. Johannes SchindelinJul 3, 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.