Re: [PATCH] pull: add pull.autoStash config option
- From
Lidong Yan <yldhome2d2@gmail.com>
- Date
- Jul 17, 2025, 05:01 UTC
- Message-ID
- <174669ED-8E02-49BB-BD61-277DBCA4D890@gmail.com>
- In-Reply-To
- <xmqqms938mbq.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> write:
Show 14 quoted lines
> > Lidong Yan <yldhome2d2@gmail.com> writes: > >>>> +pull.autoStash:: >>>> + When true, Git will automatically perform a `git stash` before the >>>> + operation and then restore the local changes with `git stash pop` >>>> + after the merge or rebase is complete. This means that you can run >>> >>> I wonder if you meant "pull" instead of "merge or rebase". >> >> Yes, I think I should also say that pull.autoStash only works if we set pull.rebase. > > Is that wise, though? When pull.rebase is false, shouldn't pull.autostash > pass --autostash to underlying "git merge" instead?
Here set pull.rebase means either set pull.rebase to true or false. And my patch will autostash if pull.rebase = false.
Show 5 quoted lines
> I've written about the interaction among three commands and > autostash in another message several hours ago, so I won't repeat > it. > > https://lore.kernel.org/git/xmqq5xfsdv3w.fsf@gitster.g/
Yeah. Though I considered that when pull.rebase = false, checking merge.autoStash instead of rebase.autoStashmight confuse users who rely on setting rebase.autoStash for their merge operations.