Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builtin/pull.c: use config value of autostash #1179

Closed
wants to merge 1 commit into from

Conversation

john-cai
Copy link
Contributor

@john-cai john-cai commented Jan 4, 2022

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:

  1. --autostash passed in through command line

$ git pull --autostash

merge/rebase should get --autostashed passed through

  1. --rebase passed in, rebase.autostash set in config

$ git config rebase.autostash true
$ git pull --rebase

merge/rebase should get --autostash from config

  1. --no-autostash passed in

$ git pull --no-autostash

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

  1. 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.

cc: René Scharfe l.s.r@web.de
cc: Philippe Blain levraiphilippeblain@gmail.com
cc: Tilman Vogel tilman.vogel@web.de

@gitgitgadget-git
Copy link

There is an issue in commit c5e7035:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit ecd7177:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit fd8964d:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit a720f1b:
Commit not signed off

@webstech
Copy link
Contributor

webstech commented Jan 4, 2022

@john-cai

Commit not signed off

It looks like you manually entered the sign off - Signed-Off-By. Git generated sign offs are Signed-off-by.

If this was generated by another tool let me know.

@gitgitgadget-git
Copy link

There is an issue in commit ba3496a:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit c231881:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit a305b73:
Commit not signed off

@john-cai
Copy link
Contributor Author

john-cai commented Jan 4, 2022

/preview

@gitgitgadget-git
Copy link

There is an issue in commit a305b73:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit b459152:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit 5c0b8da:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit 6e23e98:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit 46c4f45:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit 7139aeb:
Commit not signed off

@gitgitgadget-git
Copy link

There is an issue in commit 15eb361:
Commit not signed off

@john-cai
Copy link
Contributor Author

john-cai commented Jan 4, 2022

thanks @webstech! yes I entered it manually. I've made a bad habit of this unfortunately.

@dscho I can't seem to make the GGG PR Handler happy 😢 is it an issue with my commit formatting?

@webstech
Copy link
Contributor

webstech commented Jan 4, 2022

thanks @webstech! yes I entered it manually. I've made a bad habit of this unfortunately.

@dscho I can't seem to make the GGG PR Handler happy 😢 is it an issue with my commit formatting?

Try letting git do it: git commit --amend --signoff --no-edit

btw, you have a capital 'O' in 'off'. GitHub seems to be more forgiving on the case.

On a git pull --rebase, if fast forward is possible we run merge.
However, merge will not honor rebase.autostash if it is configured. This
has the unfortunate result of

$ git config rebase.autostash true
$ git pull --rebase

to ignore the rebase.autostash value.

Allow run_merge() to honor rebase.autostash by passing in
config_autostash if --autostash or --no-autostash flags are not
explicitly set.

Reported-by: "Tilman Vogel" <tilman.vogel@web.de>
Co-authored-by: "Junio C Hamano" <gitster@pobox.com>
Signed-off-by: "John Cai" <johncai86@gmail.com>
@phil-blain
Copy link
Contributor

This PR could be closed as this bug was fixed in 7a9ae6d

@dscho dscho closed this Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants