This patch series depends on fc/fc/pull-merge-rebase. It's basically a collection of all the pull.mode patches rebased on top of what Junio merged to jch. Except that while re-reading the old threads I noticed a suggestion by Theodore Ts'o that went unnoticed [1]. It would be very useful to make the pull.mode configuration per-repository, instead of per-branch. This way we can have two different configurations for: git pull origin * git pull john * This also could allow us in the future to have a "merge-inverted" mode so users could finally merge correctly an update from the upstream branch: master to origin/master, not origin/master to master. This in addition allows us to consider yet another possible future default: git pull # default mode: merge-inverted git pull origin master # default mode: merge Also, based on Junio's feedback [2] regarding the logic of opt_ff I decided to remove it completely, since it's clear they don't implicitely mean a merge. And finally; I noticed some quirkiness with semantics of --rebase and pull.rebase, which I handled in the last patch. Changes since v1: * Added more cleanups * Added --merge option * Added REBASE_DEFAULT * Added warning with --ff options * Added pull.mode * Added pull.mode=fast-forward (previously ff-only) * Improved --rebase and pull.rebase interaction Changes since previous patch series: * Add remote.<name>.pullmode * Remove branch.<name>.pullmode * pull.mode now overrides pull.rebase [1] https://lore.kernel.org/git/20130312212027.GE14792@xxxxxxxxx [2] https://lore.kernel.org/git/20201214202647.3340193-1-gitster@xxxxxxxxx Felipe Contreras (13): doc: pull: explain what is a fast-forward pull: improve default warning pull: cleanup autostash check pull: trivial cleanup pull: trivial whitespace style fix pull: introduce --merge option rebase: add REBASE_DEFAULT pull: move configurations fetches pull: show warning with --ff options pull: add pull.mode pull: add pull.mode=fast-forward pull: reorganize mode conditionals pull: improve --rebase and pull.rebase interaction Documentation/config/pull.txt | 6 ++ Documentation/config/remote.txt | 6 ++ Documentation/git-pull.txt | 49 ++++++++-- builtin/pull.c | 165 +++++++++++++++++++++++--------- rebase.c | 12 +++ rebase.h | 13 ++- t/t5520-pull.sh | 108 +++++++++++++++++++++ t/t7601-merge-pull-config.sh | 34 +++++-- 8 files changed, 330 insertions(+), 63 deletions(-) Range-diff: 1: 0925821483 ! 1: eb72fa24fa doc: pull: explain what is a fast-forward @@ Documentation/git-pull.txt: Assume the following history exists and the current +synchronize the local, and remote brances. + +In these situations `git pull` will warn you about your possible -+options, which are either merge, or rebase. However, by default it will -+continue doing a merge. ++options, which are either merge (`--no-rebase`), or rebase (`--rebase`). ++However, by default it will continue doing a merge. + +A merge will create a new commit with two parent commits (`G` and `C`) +and a log message describing the changes, which you can edit. @@ Documentation/git-pull.txt: and a log message from the user describing the chang In Git 1.7.0 or later, to cancel a conflicting merge, use `git reset --merge`. *Warning*: In older versions of Git, running 'git pull' +@@ Documentation/git-pull.txt: version. + + SEE ALSO + -------- +-linkgit:git-fetch[1], linkgit:git-merge[1], linkgit:git-config[1] ++linkgit:git-fetch[1], linkgit:git-merge[1], linkgit:git-rebase[1], ++linkgit:git-config[1] + + GIT + --- 2: 46c14cf851 = 2: 37d1dcecfd pull: improve default warning 3: aeb17014f5 = 3: e3d29270ac pull: cleanup autostash check -: ---------- > 4: 214bbbfcff pull: trivial cleanup -: ---------- > 5: 69c1073064 pull: trivial whitespace style fix -: ---------- > 6: 7561b4e7a8 pull: introduce --merge option -: ---------- > 7: 17bf94fb5d rebase: add REBASE_DEFAULT -: ---------- > 8: 8bd30852dd pull: move configurations fetches -: ---------- > 9: 107fd4e0db pull: show warning with --ff options -: ---------- > 10: 18d4caec8f pull: add pull.mode -: ---------- > 11: 38feb507ce pull: add pull.mode=fast-forward -: ---------- > 12: 80cd35372a pull: reorganize mode conditionals -: ---------- > 13: dc2819720a pull: improve --rebase and pull.rebase interaction -- 2.30.0.rc0