git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 00/13] pull: pull mode part 2

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 18, 2020, 21:10 UTC
Message-ID
<20201218211026.1937168-1-felipe.contreras@gmail.com>
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@thunk.org [2] https://lore.kernel.org/git/20201214202647.3340193-1-gitster@pobox.com

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
Next: Felipe Contreras
Message 1 of 14 in “pull: pull mode part 2”
  1. 00/13 pull: pull mode part 2Felipe Contreras, Dec 18, 2020
  2. 01/13 doc: pull: explain what is a fast-forwardFelipe Contreras, Dec 18, 2020
  3. 02/13 pull: improve default warningFelipe Contreras, Dec 18, 2020
  4. 04/13 pull: trivial cleanupFelipe Contreras, Dec 18, 2020
  5. 03/13 pull: cleanup autostash checkFelipe Contreras, Dec 18, 2020
  6. 05/13 pull: trivial whitespace style fixFelipe Contreras, Dec 18, 2020
  7. 06/13 pull: introduce --merge optionFelipe Contreras, Dec 18, 2020
  8. 07/13 rebase: add REBASE_DEFAULTFelipe Contreras, Dec 18, 2020
  9. 09/13 pull: show warning with --ff optionsFelipe Contreras, Dec 18, 2020
  10. 08/13 pull: move configurations fetchesFelipe Contreras, Dec 18, 2020
  11. 10/13 pull: add pull.modeFelipe Contreras, Dec 18, 2020
  12. 12/13 pull: reorganize mode conditionalsFelipe Contreras, Dec 18, 2020
  13. 13/13 pull: improve --rebase and pull.rebase interactionFelipe Contreras, Dec 18, 2020
  14. 11/13 pull: add pull.mode=fast-forwardFelipe Contreras, Dec 18, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.