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

Re: [FEATURE] Proposal: git stash --only-unstaged

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Sep 16, 2025, 17:10 UTC
Message-ID
<CALnO6CBprG+TSa3vtVjDOX5sF3MorvPv4Do7gA8mXXz26+3hUA@mail.gmail.com>
In-Reply-To
<4b689f92-5277-4e57-b4b7-8cc241ddd664@gmail.com>
On Tue, Sep 16, 2025 at 7:03 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 23 quoted lines
>
> Hi Ben
>
> On 29/08/2025 14:30, D. Ben Knoble wrote:
> > On Fri, Aug 29, 2025 at 9:06 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
> >>
> >> I think the example works but may generate conflicts when the stash is
> >> popped. One can argue that the conflicts are unnecessary because they
> >> could be avoided by popping the unstaged changes but I don't think the
> >> example is broken as such.
> >
> > Thanks, let me try to rephrase: the example makes no mention of
> > conflicts appearing or having to adjust them. It seems to heavily
> > imply to me that no such conflicts are expected, though as we
> > discussed upthread it seems unlikely you _won't_ get conflicts if you
> > do
>
> Yes, I think if you edit any staged changes (that is the lines that
> differed between the index and HEAD when "git stash" was run) you'll end
> up with conflicts. If you edit a line where the index, HEAD and the
> worktree matched when the stash was created then I don't think you will
> see a conflict. Overall conflicts seem pretty likely, so maybe we should
> mention them in the documentation.

Thanks—I realize we were talking across each other, so I'm glad we were able to get on the same page.

Show 11 quoted lines
> > [...]
> > I suppose my main complaint is nothing about the example makes it
> > clear that's the intended use case to me? Hence
> > - we could change the example to mention conflicts and/or use case
> > (smaller patch, punts on the problem)
> > - we could change the code to accommodate the example as written
> > (using ideas from your script; harder but bigger win IMO?)
>
> I was hoping that we'd hear back from J. Dettweiler as to whether the
> ideas in the script were useful. It would certainly be better to update
> the command to avoid conflicts if we can.
Sounds like a good idea.
-- 
D. Ben Knoble
Previous: Phillip Wood
Message 11 of 11 in “[FEATURE] Proposal: git stash --only-unstaged”
  1. J. DettweilerAug 13, 2025
  2. Junio C HamanoAug 13, 2025
  3. D. Ben KnobleAug 13, 2025
  4. Phillip WoodAug 16, 2025
  5. Junio C HamanoAug 17, 2025
  6. Phillip WoodAug 18, 2025
  7. Ben KnobleAug 18, 2025
  8. Phillip WoodAug 29, 2025
  9. D. Ben KnobleAug 29, 2025
  10. Phillip WoodSep 16, 2025
  11. D. Ben KnobleSep 16, 2025

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.