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

Re: [BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository

From
Ben Knoble <ben.knoble@gmail.com>
Date
Jul 17, 2025, 19:32 UTC
Message-ID
<66D1F0CE-3DBC-45BE-A777-606D50E84094@gmail.com>
In-Reply-To
<xmqq5xfsdv3w.fsf@gitster.g>
Show 25 quoted lines
> Le 16 juil. 2025 à 11:17, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> Johannes Sixt <j6t@kdbg.org> writes:
> 
>> Instead of this complexity, it is most likely a lot easier to fix the
>> origin of the misconception that `pull.autostash` is the correct
>> configuration. After all, it isn't even mentioned in the git-config nor
>> the git-pull man page.
> 
> git_pull_config() does pay attention to "rebase.autostash".  
> 
> Either it is a bug for the code to do so, or it is a bug that the
> documentation does not talk about it.  
> 
> The reason why I think "git pull" that pays attention to
> rebase.autostash is a bug is because the user is more likely to be
> much more familiar with both branches involved and more likely to be
> prepared to deal with conflicts potentially created by autostashing
> behaviour when making a private merge or rebase of local branches,
> than when pulling from other repositories.  So those who show
> willingness to accept the responsibility of having to resolve
> conflicts that arise when popping autostashed changes by setting
> rebase.autostash may not want to be cavalier to the same degree when
> running "git pull".  git_pull_config() that pays attention to
> "rebase.autostash" breaks that expectation.
On the other hand, a pull that rebases is (conceptually) a fetch followed by a rebase, and there is a lot of description and teaching of pull as fetch+merge. Breaking that expectation is also unnatural.
I would consider it far more inconsistent if pulls that rebase don’t honor rebase configuration. So put me in the camp that pull should probably respect merge.autostash, too. (I don’t have any opinion about pull.autostash, which seems reasonable on the surface.)
Show 7 quoted lines
> 
> There is another curiosity.  git_pull_config() does not pay
> attention to "merge.autostash", which seems inconsistent.
> 
> If I did not have any existing users, I would actually vote to teach
> git_pull_config() stop paying attention to "rebase.autostash", but
> we do not live in an ideal world.  Perhaps rectify this at Git 3.0?
Previous: Junio C Hamano
Message 23 of 23 in “[BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository”
  1. Bryan LeeJul 15, 2025
  2. Lidong YanJul 15, 2025
  3. Bryan LeeJul 15, 2025
  4. Bryan LeeJul 15, 2025
  5. Lidong YanJul 15, 2025
  6. Junio C HamanoJul 15, 2025
  7. Lidong YanJul 16, 2025
  8. Johannes SixtJul 16, 2025
  9. Lidong YanJul 16, 2025
  10. Junio C HamanoJul 16, 2025
  11. pull: add pull.autoStash config optionLidong Yan, Jul 17, 2025
  12. Eric SunshineJul 17, 2025
  13. Lidong YanJul 17, 2025
  14. Junio C HamanoJul 17, 2025
  15. Lidong YanJul 17, 2025
  16. Junio C HamanoJul 17, 2025
  17. Junio C HamanoJul 17, 2025
  18. pull: add pull.autoStash config optionLidong Yan, Jul 18, 2025
  19. Junio C HamanoJul 18, 2025
  20. Lidong YanJul 19, 2025
  21. pull: add pull.autoStash config optionLidong Yan, Jul 20, 2025
  22. Junio C HamanoJul 21, 2025
  23. Ben KnobleJul 17, 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.