git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>, Elijah Newren <newren@gmail.com>
Subject: [PATCH v2 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames
Date: Sat, 08 Aug 2020 17:01:18 +0000	[thread overview]
Message-ID: <b4e165eca4f6db4d876bfde31d410250c21aab6f.1596906081.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.827.v2.git.git.1596906081.gitgitgadget@gmail.com>

From: Elijah Newren <newren@gmail.com>

merge-recursive treats an add/add conflict where one of the adds came
from a rename as a separate 'rename/add' type of conflict.  However, if
there is not content conflict after the content merge(s), then the file
is not considered to be conflicted.  That suggests the conflict type is
really just add/add.  Other merge engines might choose to print messages
to the console that just refer to these as add/add conflicts; accept
both types of output.

Note: it could help to notify users if the three-way content merge of
the rename had content conflicts, because when we then go to two-way
merge THAT with the conflicting add we can get nested conflict markers.
merge-recursive, unfortunately, doesn't do that, but other merge engines
could.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh   | 21 +++++++++++++--------
 t/t6426-merge-skip-unneeded-updates.sh |  2 +-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 2413f517e7..f3929b65c0 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -457,7 +457,7 @@ test_expect_success 'handle rename-with-content-merge vs. add' '
 		git checkout A^0 &&
 
 		test_must_fail git merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/add)" out &&
+		test_i18ngrep "CONFLICT (.*/add)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -503,7 +503,7 @@ test_expect_success 'handle rename-with-content-merge vs. add, merge other way'
 		git checkout B^0 &&
 
 		test_must_fail git merge -s recursive A^0 >out &&
-		test_i18ngrep "CONFLICT (rename/add)" out &&
+		test_i18ngrep "CONFLICT (.*/add)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -886,12 +886,17 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git checkout B^0 &&
 		test_must_fail git merge -s recursive A^0 >out 2>err &&
 
-		# Not sure whether the output should contain just one
-		# "CONFLICT (rename/add/delete)" line, or if it should break
-		# it into a pair of "CONFLICT (rename/delete)" and
-		# "CONFLICT (rename/add)"; allow for either.
-		test_i18ngrep "CONFLICT (rename.*add)" out &&
-		test_i18ngrep "CONFLICT (rename.*delete)" out &&
+		# Instead of requiring the output to contain one combined line
+		#   CONFLICT (rename/add/delete)
+		# or perhaps two lines:
+		#   CONFLICT (rename/add): new file collides with rename target
+		#   CONFLICT (rename/delete): rename source removed on other side
+		# and instead of requiring "rename/add" instead of "add/add",
+		# be flexible in the type of console output message(s) reported
+		# for this particular case; we will be more stringent about the
+		# contents of the index and working directory.
+		test_i18ngrep "CONFLICT (.*/add)" out &&
+		test_i18ngrep "CONFLICT (rename.*/delete)" out &&
 		test_must_be_empty err &&
 
 		git ls-files -s >file_count &&
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index 5a2d07e516..699813671c 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -374,7 +374,7 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
 		export GIT_MERGE_VERBOSITY &&
 		test_must_fail git merge -s recursive B^0 >out 2>err &&
 
-		test_i18ngrep "CONFLICT (rename/add): Rename b->c" out &&
+		test_i18ngrep "CONFLICT (.*/add):" out &&
 		test_must_be_empty err &&
 
 		# Make sure c WAS updated
-- 
gitgitgadget


  parent reply	other threads:[~2020-08-08 17:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 16:29 [PATCH] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
2020-08-09  2:30     ` Eric Sunshine
2020-08-08 17:01   ` [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
2020-08-09  3:12     ` Eric Sunshine
2020-08-09  5:34       ` Elijah Newren
2020-08-08 17:01   ` [PATCH v2 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
2020-08-08 17:01   ` Elijah Newren via GitGitGadget [this message]
2020-08-08 17:01   ` [PATCH v2 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget
2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4e165eca4f6db4d876bfde31d410250c21aab6f.1596906081.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).