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

Re: [PATCH v3 5/5] pull: add warning on non-ff merges

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Sep 9, 2013, 01:49 UTC
Message-ID
<CAMP44s0z2=-SEJD8=K31MBcuPx=Xx__6BKaqd-MmXjAVTOr7mQ@mail.gmail.com>
In-Reply-To
<1378689796-19305-6-git-send-email-felipe.contreras@gmail.com>

On Sun, Sep 8, 2013 at 8:23 PM, Felipe Contreras <felipe.contreras@gmail.com> wrote:

Show 8 quoted lines
> To prepare our uses for the upcoming changes we should warn them and let
> them know that they will need to specify a merge or a rebase in the
> future (when a non-fast-forward situation arises). Also, let them know
> we fallback to 'git pull --merge', so when the obsoletion of this mode
> comes, they know what to type without interrupting or changing their
> workflow.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

On top of this, we probably would want to update the documentation, so the user can already read about what's going on when they type 'git pull --help' as the warning suggests.

commit 60a2f5de7da2e119b858c7ab57b5f02cce9bdb9f
Author: Felipe Contreras <felipe.contreras@gmail.com>
Date:   Sun Sep 8 20:40:21 2013 -0500
    pull: add documentation about non-ff merges
    Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 6d55737..d503924 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -23,6 +23,7 @@ More precisely, 'git pull' runs 'git fetch' with the given
 parameters and calls 'git merge' to merge the retrieved branch
 heads into the current branch.
 With `--rebase`, it runs 'git rebase' instead of 'git merge'.
+With `--merge`, it forces the merge, even if it's non-fast forward.

 <repository> should be the name of a remote repository as
 passed to linkgit:git-fetch[1].  <refspec> can name an
@@ -41,9 +42,26 @@ Assume the following history exists and the current branch is
 ------------
          A---B---C origin/master
         /
+    D---E master
+------------
+
+Then `git pull` will merge in a fast-foward way up to the new master.
+
+------------
+    D---E---A---B---C master, origin/master
+------------
+
+However, a non-fast-foward case looks very different.
+
+------------
+         A---B---C origin/master
+        /
     D---E---F---G master
 ------------

+In the future, `git pull` will fail on these situations, however, most likely
+you would want to force a merge, which you can do with `git pull --merge`.
+
 Then "`git pull`" will fetch and replay the changes from the remote
 `master` branch since it diverged from the local `master` (i.e., `E`)
 until its current commit (`C`) on top of `master` and record the
-- 
Felipe Contreras
Previous: Felipe Contreras
Message 24 of 24 in “Preparation for non-ff pulls by default”
  1. 0/5 Preparation for non-ff pulls by defaultFelipe Contreras, Sep 9, 2013
  2. 1/5 pull: rename pull.rename to pull.modeFelipe Contreras, Sep 9, 2013
  3. Richard HansenSep 9, 2013
  4. Felipe ContrerasSep 9, 2013
  5. Jeff KingSep 10, 2013
  6. Felipe ContrerasSep 10, 2013
  7. Jeff KingSep 10, 2013
  8. Matthieu MoySep 10, 2013
  9. Felipe ContrerasOct 11, 2013
  10. Richard HansenOct 12, 2013
  11. Jeff KingOct 12, 2013
  12. Felipe ContrerasOct 12, 2013
  13. Jeff KingOct 12, 2013
  14. Felipe ContrerasOct 12, 2013
  15. Richard HansenOct 12, 2013
  16. Felipe ContrerasOct 12, 2013
  17. Richard HansenSep 19, 2013
  18. Felipe ContrerasOct 11, 2013
  19. Junio C HamanoSep 10, 2013
  20. 2/5 pull: refactor $rebase variable into $modeFelipe Contreras, Sep 9, 2013
  21. 3/5 pull: add --merge optionFelipe Contreras, Sep 9, 2013
  22. 4/5 pull: add merge-ff-only optionFelipe Contreras, Sep 9, 2013
  23. 5/5 pull: add warning on non-ff mergesFelipe Contreras, Sep 9, 2013
  24. Felipe ContrerasSep 9, 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.