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

Re: [PATCH] [RFC PATCH] stash save/push: add --index-only option

From
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Date
Feb 13, 2020, 17:12 UTC
Message-ID
<CAOc6etYQPi6ghjVGdUc8Mk6oD946-YL35rJ3f9wKFSy74F450A@mail.gmail.com>
In-Reply-To
<xmqqr1yys9ze.fsf@gitster-ct.c.googlers.com>
On Thu, Feb 13, 2020 at 10:55 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> IIUC, the simplest workflow using the new feature may go like this:
>
>         $ edit file ;# edit a bit
>         $ git add file
>         $ edit file ;# even even more
>         $ git stash --cached
>
> After all of the above is done, "git stash list" may show that there
> is a single stash that records the changes you made to the file
> right after you added it, without your further changes (because you
> are taking what is in the index).  Your working tree has all the
> changes you made to file, both before and after "git add", and your
> index is clean.
>
> After you got yourself into this state where your index is clean,
> your working tree file has all changes, and your stash entry has
> only the earlier half of the change, what are you going to do with
> that stash entry?  If we learn the answer to that question, perhaps
> we may find (or we may even have) a better or easier way to achieve
> whatever you were planning to do with that stash entry by some other
> means---it might not even involve "git stash"---but without knowing
> that, we cannot tell if the new feature is a good idea.

Actually, let this conversation burn in /dev/null. What I want to achieve (stash only some changes and not all of them) can be done by using git stash push providing pathspec.

>
> Thanks.
Thank you!
Previous: Junio C Hamano
Message 6 of 6 in “stash save/push: add --index-only option”
  1. [RFC PATCH] stash save/push: add --index-only optionEdmundo Carmona Antoranz, Feb 12, 2020
  2. Edmundo Carmona AntoranzFeb 12, 2020
  3. Junio C HamanoFeb 13, 2020
  4. Edmundo Carmona AntoranzFeb 13, 2020
  5. Junio C HamanoFeb 13, 2020
  6. Edmundo Carmona AntoranzFeb 13, 2020

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.