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

Re: Git automatic stashing?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Nov 9, 2010, 07:49 UTC
Message-ID
<vpqlj53j5rv.fsf@bauges.imag.fr>
In-Reply-To
<AANLkTinwftXiZxbs_=PeM-MxQmMF4VaBCPEufH=OG6iU@mail.gmail.com>
Casey McGinty <casey.mcginty@gmail.com> writes:
> Is there any feature in git to perform and auto stash apply/pop when
> trying to do a merge/rebase in a dirty working dir? This would save
> some keystrokes from time-to-time, and make it easier for new users
> unfamiliar with git.

I agree with the keystrokes part, but not with the fact that it would make it easier in general. In the sequence

git stash git merge git stash pop

conflicts can occur in 2 distinct places. One can easily forsee this senario occuring:

git stash git merge # fix conflicts # git commit # forget to do the action needed to get the "git stash pop"

and voila, you've just lost data.

Actually, what I'd like to see would be this feature, but limited to the case where the merge is a fast-forward, because then, only the last action of the sequence could possibly leave conflict, so Git could finish with a message like "please fix conflicts and continue working". Actually, this is not far from what "git checout -m" is doing.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Casey McGintyNext: Martin von Zweigbergk
Message 2 of 7 in “Git automatic stashing?”
  1. Casey McGintyNov 9, 2010
  2. Matthieu MoyNov 9, 2010
  3. Martin von ZweigbergkNov 9, 2010
  4. Nguyen Thai Ngoc DuyNov 9, 2010
  5. Martin von ZweigbergkNov 9, 2010
  6. Matthieu MoyNov 9, 2010
  7. Thomas RastNov 9, 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.