You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rev_news/drafts/edition-126.md
+77-2Lines changed: 77 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,84 @@ This edition covers what happened during the months of July 2025 and August 2025
25
25
### Reviews
26
26
-->
27
27
28
-
<!---
28
+
29
29
### Support
30
-
-->
30
+
31
+
*[[BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository](https://lore.kernel.org/git/010001980c1ee007-2797fc86-fdf3-46e9-bec9-f8da2c9ebb8d-000000@email.amazonses.com/)
32
+
33
+
Bryan Lee posted a bug report about the `pull.autostash`
34
+
configuration variable being ignored in a repository used to manage
35
+
his dotfiles.
36
+
37
+
He expected his unstaged changes to be automatically stashed before
38
+
a pull when that configuration variable is set to `true`. Instead,
39
+
the command failed with an error message telling him to "Please
40
+
commit or stash them". So he thought Git ignored the autostash
41
+
configuration completely due to the setup, which consisted of a bare
42
+
repository and a separate work tree accessed through the following
43
+
alias:
44
+
45
+
`$ alias dot='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'`
46
+
47
+
Lidong Yan replied to Bryan admitting that he wasn't sure why the
48
+
autostash feature would be ignored when using the `--git-dir` and
49
+
`--work-tree` flags. He suggested setting `rebase.autostash` instead
50
+
of `pull.autostash` to `true` though.
51
+
52
+
Bryan Lee thanked Lidong saying that `pull.autostash` is not a Git
53
+
configuration option and that `rebase.autostash` does work for
54
+
rebase operations. But he raised the issue that Git silently accepts
55
+
invalid configuration keys without any warning, which can cause
56
+
users to waste a lot of time debugging.
57
+
58
+
Lidong replied with a suggestion to add a `git config verify`
59
+
subcommand. But Junio Hamano, the Git maintainer, chimed in
60
+
expressing doubts about such a command, as Git cannot distinguish
61
+
between a typo of a known variable and a legitimate custom variable
62
+
that a user or a third-party tool might be using. Lidong elaborated
63
+
that such a command could work by having Git maintain an internal
64
+
registry of all valid keys, which could also be extended by users
65
+
and tools for their own custom configurations.
66
+
67
+
Johannes Sixt suggested that instead of building a complex
68
+
verification system, it would be easier to fix the origin of the
69
+
misconception that `pull.autostash` was the correct configuration.
70
+
71
+
Junio replied to Johannes that having `git pull` pay attention to
72
+
`rebase.autostash` was at least a documentation failure, if not a
73
+
bug. He argued that users have different expectations for a
74
+
relatively safe local rebase compared to a pull from a remote, which
75
+
could be riskier. Also it didn't make sense for `git pull` to
76
+
respect `rebase.autostash` but not `merge.autostash`.
77
+
78
+
Ben Knoble then chimed in with a counter-argument to Junio. He
79
+
reasoned that since a `git pull` that rebases is conceptually a
80
+
fetch followed by a rebase, it would be "far more inconsistent" if
81
+
it didn't honor the rebase configuration. Breaking that expectation
82
+
would be unnatural for users taught to think of pull in that
83
+
way. Following this logic, he also supported the idea that a merging
84
+
pull should respect `merge.autostash`.
85
+
86
+
Then Junio wondered if introducing a new, dedicated `pull.autostash`
87
+
variable would be a good idea. But soon Lidong came up with
0 commit comments