From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] rerere: demonstrate a weakness with identical conflicts in different files
Date: Thu, 12 Aug 2010 09:28:18 +0200 [thread overview]
Message-ID: <4C63A292.4010604@viscovery.net> (raw)
In-Reply-To: <7vfwykv92a.fsf@alter.siamese.dyndns.org>
Am 8/12/2010 4:50, schrieb Junio C Hamano:
> Yes, rr-cache/ database keys off of the
> conflict id, so if your repository has more than one contents that produce
> exactly the same conflict, say F and G, then, most likely:
>
> * You see one of them first, say F, record preimage.F and record its
> resolution as postimage.F
>
> * You encounter conflict G; record it in thisimage, try three-way merge
> between postimage.F and that using preimage.F as the common ancestor.
> If this doesn't work (and it likely doesn't), rerere punts.
Aha! Since the files differ in the immediate neighborhood of the context
markers, the merge that applies the resolution fails.
Squash in this and the test passes:
diff --git a/t/t4208-rerere-dup.sh b/t/t4208-rerere-dup.sh
index 34c182a..2afa0ef 100755
--- a/t/t4208-rerere-dup.sh
+++ b/t/t4208-rerere-dup.sh
@@ -12,6 +12,7 @@
test_expect_success 'setup' '
cat > a1 <<- EOF &&
alpha
+ delta
beta
gamma
EOF
@@ -23,6 +24,7 @@ test_expect_success 'setup' '
git checkout -b first &&
cat > a1 <<- EOF &&
alpha
+ delta
BETA
gamma
EOF
@@ -32,6 +34,7 @@ test_expect_success 'setup' '
git checkout master &&
cat > a1 <<- EOF &&
alpha
+ delta
----
gamma
EOF
@@ -49,6 +52,7 @@ test_expect_success 'merge records
test_expect_success 'record a resolution' '
cat > a1 <<- EOF &&
alpha
+ delta
--beta--
gamma
EOF
@@ -61,7 +65,7 @@ test_expect_success 'postimage must
'
test_expect_success 'same resolution recorded twice' '
- test $(grep "Recorded resolution" actual | wc -l) = 2 &&
+# test $(grep "Recorded resolution" actual | wc -l) = 2 &&
test $(ls .git/rr-cache | wc -w) = 1
'
The last hunk is necessary because the output of rerere is now:
Recorded resolution for 'a1'.
Resolved 'a2' using previous resolution.
where the second statement is slightly misleading because the resolution
was not "used". But already present in the file (the resolution-merge
still succeeded, hence, rerere thought it had "used" the resolution).
I assumed that in my case I had identical text immediately outside the
conflict markers, and so I also assumed that the resolution-merge would
succeed, but it seems I was wrong. I'll go back and investigate closer as
time permits.
Thanks for your help so far.
-- Hannes
prev parent reply other threads:[~2010-08-12 7:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 12:16 [PATCH] rerere: demonstrate a weakness with identical conflicts in different files Johannes Sixt
2010-08-11 23:35 ` Junio C Hamano
2010-08-12 2:50 ` Junio C Hamano
2010-08-12 7:28 ` Johannes Sixt [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C63A292.4010604@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
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 NNTP newsgroup(s).