From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Lidong Yan <yldhome2d2@gmail.com>, Bryan Lee <hi@looping.me>,
git@vger.kernel.org
Subject: Re: [BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository
Date: Wed, 16 Jul 2025 08:16:19 -0700 [thread overview]
Message-ID: <xmqq5xfsdv3w.fsf@gitster.g> (raw)
In-Reply-To: <26cef1b9-1f17-447e-b647-3d32a3984997@kdbg.org> (Johannes Sixt's message of "Wed, 16 Jul 2025 07:55:34 +0200")
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.
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?
We could give a convenience feature in the opposite direction as
well.
It is not inconceivable for the git_pull_config() function to
pretend as if rebase.autostash (when pull.rebase is true) or
merge.autostash (otherwise) is set to true when pull.autostash is
set to true. It would have prevented this discussion thread from
happening.
I personally think that such an arrangement is backwards, though,
for the same reason why I think git_pull_config() should not pay
attention to "rebase.autostash". So I am not sure if a new
"pull.autostash" variable is such a good idea to begin with.
next prev parent reply other threads:[~2025-07-16 15:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 3:26 [BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository Bryan Lee
2025-07-15 4:09 ` Lidong Yan
2025-07-15 5:31 ` Bryan Lee
2025-07-15 5:31 ` Bryan Lee
2025-07-15 15:02 ` Lidong Yan
2025-07-15 20:46 ` Junio C Hamano
2025-07-16 1:39 ` Lidong Yan
2025-07-16 5:55 ` Johannes Sixt
2025-07-16 11:20 ` Lidong Yan
2025-07-16 15:16 ` Junio C Hamano [this message]
2025-07-17 3:07 ` [PATCH] pull: add pull.autoStash config option Lidong Yan
2025-07-17 3:27 ` Eric Sunshine
2025-07-17 4:09 ` Lidong Yan
2025-07-17 4:37 ` Junio C Hamano
2025-07-17 5:01 ` Lidong Yan
2025-07-17 5:48 ` Junio C Hamano
2025-07-17 4:44 ` Junio C Hamano
2025-07-18 3:52 ` Lidong Yan
2025-07-18 22:13 ` Junio C Hamano
2025-07-19 3:14 ` Lidong Yan
2025-07-20 12:43 ` [PATCH v2] " Lidong Yan
2025-07-21 22:10 ` Junio C Hamano
2025-07-17 19:32 ` [BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository Ben Knoble
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5xfsdv3w.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hi@looping.me \
--cc=j6t@kdbg.org \
--cc=yldhome2d2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).