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

Re: I tried the latest git (was: A bug or issue with "git rebase --autostash" not popping the stash automatically)

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Dec 13, 2021, 13:53 UTC
Message-ID
<9b2c663e-9637-63b7-f42b-69a6a0b6531a@gmail.com>
In-Reply-To
<2018444639.308810.1636973639331@ox-webmail.xs4all.nl>
Hi Henk,
Le 2021-11-15 à 05:53, Henk Smit a écrit :
Show 31 quoted lines
> Hello Philip,
> 
> I just cloned a copy of the git source code.
> And built the "next" branch.
> And tried it myself.
> 
> $ git config --get-regexp alias
> alias.up !git fetch && git rebase --autostash origin
> 
> 
> To my surprise, the stash was applied!
> And changes/conflicts were merged in.
> However, the text put out by git wasn't very clear.
> And the stash was not deleted by itself.
> 
> Created autostash: 6c072c0da335
> Applying autostash resulted in conflicts.
> Your changes are safe in the stash.
> You can run "git stash pop" or "git stash drop" at any time.
> Successfully rebased and updated refs/heads/main.
> $ git stash list
> stash@{0}: autostash
> 
> $ git --version
> git version 2.34.0.rc2.399.gc874808226
> 
> So there is progress!
> The changes are merged/edited in.
> But the stash remains. Imho it should be deleted, if the stash applied without any problems.
> What do you think?
> 

The stash was applied and it resulted in conflicts, so the stash entry stays in the stash list. The rationale, I think, is that you might not want to deal with that conflict now, so since the stash is kept, you can 'git checkout HEAD -- .' to remove the conflict and get back to the file state recorded in HEAD, and deal with the stash later.

> If you and others think the stash should remain, maybe we can add a flag or config-option
> to force the deletion of the stash, after a successful apply? Or would that be too risky?
I think that it could be reasonable for that behaviour to be configurable, yes.
> Could a simple non-git expert like myself do those changes, and offer them to the git project?
> Or do they not trust strangers enough for such changes?

Yes, the Git projects welcomes contributions from everyone. I encourage you to give 'MyFirstContribution' [1] a read :)

Cheers,
Philippe.
[1] https://git-scm.com/docs/MyFirstContribution
Previous: Henk Smit
Message 3 of 3 in “Re: A bug or issue with "git rebase --autostash" not popping the stash automatically”
  1. Philippe BlainDec 13, 2021
  2. Henk SmitDec 14, 2021
  3. Philippe BlainDec 13, 2021

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.