From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Linus Torvalds <torvalds@osdl.org>,
Ramsay Jones <ramsay@ramsay1.demon.co.uk>,
git@vger.kernel.org
Subject: Re: using xdl_merge(), was Re: Resolving conflicts
Date: Tue, 05 Dec 2006 11:50:56 -0800 [thread overview]
Message-ID: <7vac22glzz.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0612051949290.28348@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Tue, 5 Dec 2006 19:53:09 +0100 (CET)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Tue, 5 Dec 2006, Linus Torvalds wrote:
>
>> - take every single merge in git (or the kernel, if you want even more)
The attached is the script I am using. The test checks the
output from 'master' (merge from RCS) and 'next' (with xdl-merge)
and also tries to see how different the conflicts look like.
In the git.git archive, there is no "clean" merge on which
'master' and 'next' did not agree. It is not a proof of
correctness at all but it gives a sense of assurance.
However, the conflict 'next' leaves seems a bit suspicious.
Trying to reproduce
56f9686c4d1e1d586b731b815bd98d70f84ecda4
gives an interesting illustration.
Here is one conflicted hunk from that merge (RCS merge)
-- 8< -- RCS merge conflict hunk, diff from the 1st parent -- 8< --
--- a/Makefile
+++ b/Makefile
@@ -232,8 +232,13 @@ LIB_FILE=libgit.a
XDIFF_LIB=xdiff/lib.a
LIB_H = \
+<<<<<<< HEAD/Makefile
archive.h blob.h cache.h commit.h csum-file.h delta.h \
diff.h object.h pack.h pkt-line.h quote.h refs.h \
+=======
+ blob.h cache.h commit.h csum-file.h delta.h \
+ diff.h object.h pack.h pkt-line.h quote.h refs.h sideband.h \
+>>>>>>> d47f3db75c58139cdcbca5cc63b17bf5db293b6a/Makefile
run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h
-- >8 -- RCS merge conflict hunk, diff from the 1st parent -- >8 --
-- 8< -- JS merge conflict hunk, diff from the 1st parent -- 8< --
--- a/Makefile
+++ b/Makefile
@@ -232,8 +232,14 @@ LIB_FILE=libgit.a
XDIFF_LIB=xdiff/lib.a
LIB_H = \
+<<<<<<< HEAD/Makefile
archive.h blob.h cache.h commit.h csum-file.h delta.h \
diff.h object.h pack.h pkt-line.h quote.h refs.h \
+=======
+ blob.h cache.h commit.h csum-file.h delta.h \
+ diff.h object.h pack.h pkt-line.h quote.h refs.h sideband.h \
+>>>>>>> d47f3db75c58139cdcbca5cc63b17bf5db293b6a/Makefile
+ diff.h object.h pack.h pkt-line.h quote.h refs.h sideband.h \
run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h
-- >8 -- JS merge conflict hunk, diff from the 1st parent -- >8 --
Notice that there is one duplicated line after the closing
conflict marker?
-- 8< -- remerge.sh test script -- 8< --
#!/bin/sh
# Leaves things to be examined in /var/tmp/remerge-$$/
ogit=$HOME/git-master/bin/git
ngit=$HOME/git-next/bin/git
tmp=/var/tmp/remerge-$$-tmp
trap 'rm -f $tmp-*' 0
# Revlist
if ! test -f ./+RL
then
git rev-list --parents HEAD |
perl -n -e 'if (/^[0-9a-f]{40} [0-9a-f]{40} [0-9a-f]{40}$/) {
print;
}' >./+RL
fi
try_one () {
# should be on a discardable branch.
git=$1 parent1=$2 parent2=$3
$git reset --hard "$parent1"
if $git merge "$parent2"
then
echo clean merge
$git diff-tree -r --raw "$parent1" HEAD
else
echo conflicted merge
$git ls-files -u
$git diff --binary -p "$parent1"
fi
}
# Make sure we do not trash anything important
current=`git symbolic-ref HEAD`
if test "z$current" != zrefs/heads/remerge-test
then
git checkout -b remerge-test ||
git checkout remerge-test
current=`git symbolic-ref HEAD`
test "z$current" = zrefs/heads/remerge-test || exit
fi
while read result parent1 parent2
do
try_one $ogit $parent1 $parent2 >$tmp-1 2>/dev/null
try_one $ngit $parent1 $parent2 >$tmp-2 2>/dev/null
if diff $tmp-1 $tmp-2
then
echo "Ok"
else
echo "Bad $result"
mkdir -p $tmp/$result
mv $tmp-1 $tmp/$result/ogit
mv $tmp-2 $tmp/$result/ngit
fi
$git reset --hard
done < ./+RL
next prev parent reply other threads:[~2006-12-05 19:51 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-01 7:06 Resolving conflicts Wink Saville
2006-12-01 7:30 ` Alan Chandler
2006-12-01 7:41 ` Wink Saville
2006-12-01 8:10 ` Alan Chandler
2006-12-01 7:39 ` Linus Torvalds
2006-12-01 7:52 ` Wink Saville
2006-12-01 7:57 ` Linus Torvalds
2006-12-01 8:00 ` Linus Torvalds
2006-12-01 8:13 ` Alan Chandler
2006-12-01 8:22 ` Wink Saville
2006-12-01 23:47 ` Alan Chandler
2006-12-02 3:04 ` Wink Saville
2006-12-02 4:30 ` Linus Torvalds
2006-12-02 7:55 ` Junio C Hamano
2006-12-02 10:49 ` using xdl_merge(), was " Johannes Schindelin
2006-12-05 17:58 ` Ramsay Jones
2006-12-05 18:28 ` Linus Torvalds
2006-12-05 18:43 ` Junio C Hamano
2006-12-05 18:53 ` Johannes Schindelin
2006-12-05 19:50 ` Junio C Hamano [this message]
2006-12-05 21:15 ` [PATCH] xdl_merge(): fix and simplify conflict handling Johannes Schindelin
2006-12-05 22:10 ` Junio C Hamano
2006-12-05 22:24 ` Johannes Schindelin
2006-12-05 22:54 ` Junio C Hamano
2006-12-05 22:27 ` Jakub Narebski
2006-12-05 22:27 ` Johannes Schindelin
2006-12-06 9:48 ` using xdl_merge(), was Re: Resolving conflicts Junio C Hamano
2006-12-06 10:02 ` Johannes Schindelin
2006-12-06 10:13 ` Junio C Hamano
2006-12-06 10:47 ` Johannes Schindelin
2006-12-05 18:36 ` Johannes Schindelin
2006-12-01 7:53 ` Linus Torvalds
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=7vac22glzz.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
--cc=torvalds@osdl.org \
/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).