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

Re: [PATCH 3/3] pull: introduce --[no-]autostash and pull.autostash

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 15, 2013, 13:40 UTC
Message-ID
<vpqppxvoqsc.fsf@grenoble-inp.fr>
In-Reply-To
<CALkWK0mdC_tK2CGqAa67fr189PQCjSjzAOPujipOHFfoiYW0qA@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> In the pull-merge case, maybe: if your worktree isn't clean, you lose
> a lot of goodies like merge --abort anyway, and I hate that.

AFAICT, "git merge --abort" is an alias for "git reset --merge" which was precisely designed to reset only modifications comming from a merge, and not the local changes that were present before the merge was started. The man pages are relatively obscure on the subject, but I'd call that a documentation bug.

> Overall, I don't see how an extra stash/ stash pop where not
> absolutely necessary hurts.

It does. stashing means the user will have to "stash pop" later. One extra step, one extra opportunity to forget something important.

A minor annoyance is that it will touch files that have no reason to be touched, hence may trigger extra rebuilds with "make", disturbing text editors that have the file open, etc.

The fact that "git pull" just works on dirty trees with non-overlapping changes is an important feature of Git.

Show 6 quoted lines
>> Shouldn't this belong to "git merge" instead (i.e. implement "git merge
>> --autosquash" and call it from "git pull")? Users doing "git fetch &&
>> git merge" by hand should be able to use --autosquash, I think.
>
> --autosquash reminds me of rebase.autosquash, and that is completely
> unrelated to the issue at hand.

A typo seems to have propagated in this thread. I meant auto*stash*, not auto*squash*, sorry. I guess it's the same typo in Junio's message.

Show 7 quoted lines
>> Something should be done for "git rebase" and "git pull --rebase" too.
>> In this case, the UI can be much smoother, since the user would have to
>> run "git rebase --continue" anyway, so you can do the auto-stash-pop for
>> him by adding something like "exec git stash pop" at the end of the todo-list.
>
> No.  I'm against executing a special codepath for a pull-rebase that
> has no equivalent in the pull-merge world.

I think you're taking it the wrong way. You seem to insist that autostash should be a pull feature. I think it should be a feature of merge and rebase, and the convenience script "git pull" should expose them to the user.

I see no reason to prevent users running fetch and then merge or rebase to use the autostash feature.

Show 5 quoted lines
>> Ideally, "git rebase --abort" should auto-stash-pop too, although this
>> is much less trivial to implement.
>
> As I already pointed out in my message to Junio, "fixing" rebase is
> not the topic of discussion at all.

It's not about fixing the existing rebase. It's about implementing autostash the right way.

As a user, when I run "git rebase --continue" and it tells me it's done, I expect the work to actually be done. This is the case today. This won't be the case after autostash is introduced if the user has to remember to run "stash pop" afterwards.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 20 of 44 in “Introduce pull.autostash”
  1. 0/3 Introduce pull.autostashRamkumar Ramachandra, Apr 13, 2013
  2. 1/3 pull: prefer invoking "git <command>" over "git-<command>"Ramkumar Ramachandra, Apr 13, 2013
  3. Philip OakleyApr 14, 2013
  4. 2/3 t5521 (pull-options): use test_commit() where appropriateRamkumar Ramachandra, Apr 13, 2013
  5. 3/3 pull: introduce --[no-]autostash and pull.autostashRamkumar Ramachandra, Apr 13, 2013
  6. Junio C HamanoApr 15, 2013
  7. Ramkumar RamachandraApr 15, 2013
  8. Junio C HamanoApr 15, 2013
  9. Ramkumar RamachandraApr 15, 2013
  10. Matthieu MoyApr 15, 2013
  11. Junio C HamanoApr 15, 2013
  12. Matthieu MoyApr 15, 2013
  13. Ramkumar RamachandraApr 15, 2013
  14. Matthieu MoyApr 15, 2013
  15. Ramkumar RamachandraApr 15, 2013
  16. Matthieu MoyApr 15, 2013
  17. Ramkumar RamachandraApr 15, 2013
  18. Jonathan NiederApr 16, 2013
  19. Ramkumar RamachandraApr 15, 2013
  20. Matthieu MoyApr 15, 2013
  21. Ramkumar RamachandraApr 15, 2013
  22. Ramkumar RamachandraApr 15, 2013
  23. Matthieu MoyApr 15, 2013
  24. Junio C HamanoApr 15, 2013
  25. Ramkumar RamachandraApr 15, 2013
  26. John KeepingApr 15, 2013
  27. Ramkumar RamachandraApr 15, 2013
  28. Jonathan NiederApr 16, 2013
  29. Ramkumar RamachandraApr 16, 2013
  30. Jonathan NiederApr 16, 2013
  31. Junio C HamanoApr 15, 2013
  32. Ramkumar RamachandraApr 15, 2013
  33. Junio C HamanoApr 15, 2013
  34. Ramkumar RamachandraApr 15, 2013
  35. John KeepingApr 15, 2013
  36. Matthieu MoyApr 15, 2013
  37. Ramkumar RamachandraApr 16, 2013
  38. Matthieu MoyApr 16, 2013
  39. Ramkumar RamachandraApr 16, 2013
  40. Matthieu MoyApr 16, 2013
  41. Matthieu MoyApr 16, 2013
  42. Junio C HamanoApr 16, 2013
  43. Phil HordApr 16, 2013
  44. Ramkumar RamachandraApr 16, 2013

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.