Skip to content

Fix bug in pull --rebase not recognizing rebase.autostash

John Cai git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1builtin/pull.c: use config value of autostashbuiltin/pull.c t/t5521-pull-options.sh+59 -712 replies

Reviews trailers per patch

The patch has no Reviewed-by or Acked-by.

PatchPhilippe BlainJunio C Hamano
1/1Co-authored-by Co-authored-by Helped-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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(-)
Signature · 1 line
2.34.1