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

[PATCH 0/6] Preparation for non-ff pulls by default

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Sep 2, 2013, 22:17 UTC
Message-ID
<1378160278-14872-1-git-send-email-felipe.contreras@gmail.com>

It is very typical for Git newcomers to inadvertently create merges and worst: inadvertently pushing them. This is one of the reasons many experienced users prefer to avoid 'git pull', and recommend newcomers to avoid it as well.

To avoid these problems and keep 'git pull' useful, it has been suggested that 'git pull' barfs by default if the merge is non-fast-forward, which unfortunately would break backwards compatibility.

This patch series leaves everything in place to enable this new mode, but it only gets enabled if the user specifically configures it; pull.mode = merge-ff-only.

Later on this mode can be enabled by default (e.g. in v2.0).

To achieve that first some configurations are renamed: for example: pull.rebase => pull.mode = rebase, but the old ones remain functional, thus there are no functional changes.

Felipe Contreras (6):
  merge: simplify ff-only option
  t: replace pulls with merges
  pull: rename pull.rename to pull.mode
  pull: refactor $rebase variable into $mode
  pull: add --merge option
  pull: add merge-ff-only option
 Documentation/config.txt               | 24 +++++++------
 Documentation/git-pull.txt             | 10 ++++--
 branch.c                               |  4 +--
 builtin/merge.c                        | 20 +++++------
 git-pull.sh                            | 49 ++++++++++++++++++++-------
 t/annotate-tests.sh                    |  2 +-
 t/t3200-branch.sh                      | 40 +++++++++++-----------
 t/t4200-rerere.sh                      |  2 +-
 t/t5520-pull.sh                        | 62 ++++++++++++++++++++++++++++++++++
 t/t5601-clone.sh                       |  4 +--
 t/t9114-git-svn-dcommit-merge.sh       |  2 +-
 t/t9500-gitweb-standalone-no-errors.sh |  2 +-
 12 files changed, 157 insertions(+), 64 deletions(-)
-- 
1.8.4-338-gefd7fa6
Next: Felipe Contreras
Message 1 of 7 in “Preparation for non-ff pulls by default”
  1. 0/6 Preparation for non-ff pulls by defaultFelipe Contreras, Sep 2, 2013
  2. 1/6 merge: simplify ff-only optionFelipe Contreras, Sep 2, 2013
  3. 2/6 t: replace pulls with mergesFelipe Contreras, Sep 2, 2013
  4. 3/6 pull: rename pull.rename to pull.modeFelipe Contreras, Sep 2, 2013
  5. 4/6 pull: refactor $rebase variable into $modeFelipe Contreras, Sep 2, 2013
  6. 5/6 pull: add --merge optionFelipe Contreras, Sep 2, 2013
  7. 6/6 pull: add merge-ff-only optionFelipe Contreras, Sep 2, 2013

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.