]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'en/pull-conflicting-options' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 12 Oct 2021 20:51:36 +0000 (13:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Oct 2021 20:51:36 +0000 (13:51 -0700)
"git pull" had various corner cases that were not well thought out
around its --rebase backend, e.g. "git pull --ff-only" did not stop
but went ahead and rebased when the history on other side is not a
descendant of our history.  The series tries to fix them up.

* en/pull-conflicting-options:
  pull: fix handling of multiple heads
  pull: update docs & code for option compatibility with rebasing
  pull: abort by default when fast-forwarding is not possible
  pull: make --rebase and --no-rebase override pull.ff=only
  pull: since --ff-only overrides, handle it first
  pull: abort if --ff-only is given and fast-forwarding is impossible
  t7601: add tests of interactions with multiple merge heads and config
  t7601: test interaction of merge/rebase/fast-forward flags and options

1  2 
Documentation/git-pull.txt
Documentation/merge-options.txt
advice.h
builtin/merge.c
t/t4013-diff-various.sh
t/t6402-merge-rename.sh

Simple merge
Simple merge
diff --cc advice.h
Simple merge
diff --cc builtin/merge.c
Simple merge
Simple merge
index 3da2896e3bc8dc3a6fe63dd48edce292118ee7e4,02a842697b8e1d6ff30b3f41efb2d638d745df91..3a32b1a45cf8e4bf2a7b42eeec98923262b3e470
@@@ -103,10 -103,12 +103,10 @@@ test_expect_success 'setup' 
  test_expect_success 'pull renaming branch into unrenaming one' \
  '
        git show-branch &&
-       test_expect_code 1 git pull . white &&
+       test_expect_code 1 git pull --no-rebase . white &&
        git ls-files -s &&
 -      git ls-files -u B >b.stages &&
 -      test_line_count = 3 b.stages &&
 -      git ls-files -s N >n.stages &&
 -      test_line_count = 1 n.stages &&
 +      test_stdout_line_count = 3 git ls-files -u B &&
 +      test_stdout_line_count = 1 git ls-files -s N &&
        sed -ne "/^g/{
        p
        q
@@@ -119,9 -121,11 +119,9 @@@ test_expect_success 'pull renaming bran
        rm -f B &&
        git reset --hard &&
        git checkout red &&
-       test_expect_code 1 git pull . white &&
+       test_expect_code 1 git pull --no-rebase . white &&
 -      git ls-files -u B >b.stages &&
 -      test_line_count = 3 b.stages &&
 -      git ls-files -s N >n.stages &&
 -      test_line_count = 1 n.stages &&
 +      test_stdout_line_count = 3 git ls-files -u B &&
 +      test_stdout_line_count = 1 git ls-files -s N &&
        sed -ne "/^g/{
        p
        q
@@@ -133,9 -137,11 +133,9 @@@ test_expect_success 'pull unrenaming br
  '
        git reset --hard &&
        git show-branch &&
-       test_expect_code 1 git pull . main &&
+       test_expect_code 1 git pull --no-rebase . main &&
 -      git ls-files -u B >b.stages &&
 -      test_line_count = 3 b.stages &&
 -      git ls-files -s N >n.stages &&
 -      test_line_count = 1 n.stages &&
 +      test_stdout_line_count = 3 git ls-files -u B &&
 +      test_stdout_line_count = 1 git ls-files -s N &&
        sed -ne "/^g/{
        p
        q
@@@ -147,11 -153,15 +147,11 @@@ test_expect_success 'pull conflicting r
  '
        git reset --hard &&
        git show-branch &&
-       test_expect_code 1 git pull . blue &&
+       test_expect_code 1 git pull --no-rebase . blue &&
 -      git ls-files -u A >a.stages &&
 -      test_line_count = 1 a.stages &&
 -      git ls-files -u B >b.stages &&
 -      test_line_count = 1 b.stages &&
 -      git ls-files -u C >c.stages &&
 -      test_line_count = 1 c.stages &&
 -      git ls-files -s N >n.stages &&
 -      test_line_count = 1 n.stages &&
 +      test_stdout_line_count = 1 git ls-files -u A &&
 +      test_stdout_line_count = 1 git ls-files -u B &&
 +      test_stdout_line_count = 1 git ls-files -u C &&
 +      test_stdout_line_count = 1 git ls-files -s N &&
        sed -ne "/^g/{
        p
        q