mbox series

[0/1] Fix bug in pull --rebase not recognizing rebase.autostash

Message ID 20220104214522.10692-1-johncai86@gmail.com (mailing list archive)
Headers show
Series Fix bug in pull --rebase not recognizing rebase.autostash | expand

Message

John Cai Jan. 4, 2022, 9:45 p.m. UTC
NOTE: this is my first patch I'm submitting through git send-email. Please let
me know if there is some convention that I'm missing. thank you in advance :)

A bug in pull.c causes merge and rebase functions to ignore
rebase.autostash if it is only set in the config.

There are a couple of different scenarios that we need to be mindful of:

--autostash passed in through command line
$ git pull --autostash

merge/rebase should get --autostashed passed through

--rebase passed in, rebase.autostash set in config
$ git config rebase.autostash true
$ git pull --rebase

merge/rebase should get --autostash from config

--no-autostash passed in
$ git pull --no-autostash

--no-autostash should be passed into merge/rebase

rebase.autostash set but --rebase not used
$ git config rebase.autostash true
$ git pull

--autostash should not be passed into merge but not rebase

This change adjusts variable names to make it more clear which autostash
setting it is modifying, and ensures --autostash is passed into the
merge/rebase where appropriate.

John Cai (1):
  builtin/pull.c: use config value of autostash

 builtin/pull.c          | 15 ++++++------
 t/t5521-pull-options.sh | 51 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 7 deletions(-)

Comments

Philippe Blain Jan. 4, 2022, 11:32 p.m. UTC | #1
Hi John,

Le 2022-01-04 à 16:45, John Cai a écrit :
> NOTE: this is my first patch I'm submitting through git send-email. Please let
> me know if there is some convention that I'm missing. thank you in advance :)

Usually, for one-patch series as this one, it's preferred in this project to not
send a separate cover letter, but instead to include the cover letter material below
the three dash line. You can do that manually when using 'git send-email --annotate',
or you can use the 'git notes' command along with git format-patch's '--notes'
arguments to include it automatically.

Cheers,
Philippe.