git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Palmer <wmpalmer@gmail.com>
To: git@vger.kernel.org
Cc: wmpalmer@gmail.com, gitster@pobox.com
Subject: [PATCHv2 0/2] merge-tree: fix (merge-base a b) b a
Date: Sun, 11 Jul 2010 14:16:53 +0100	[thread overview]
Message-ID: <1278854215-9022-1-git-send-email-wmpalmer@gmail.com> (raw)

This series notes, then fixes, a regression introduced by
15b4f7a68d8c3c8ee28424415b203f61202d65d1 /
	merge-tree: use ll_merge() not xdl_merge()

I don't know the proper terminology to describe what's being fixed here.
This seems to most-easily be triggered by (for example):
	git merge-tree $(git merge-base HEAD @{u}) HEAD @{u}

In the git repository at the moment, this could be triggered with:
	git merge-tree $(git merge-base origin/next origin/master) \
		origin/next origin/master

Though as I write this, next has only just been merged with master, so
that is not the case. For an example which is less likely to go away,
try:
	git merge-tree c9eaaab4165d8f402930d12899ec097495b599e6 \
		be16ac8cc8ce693c6adf37b80db65d10a41b4eb9 \
		9918285fb10d81af9021dae99c5f4de88ded497c

It's actually very trivial to reproduce this, to the point where I
can't help but wonder how much merge-tree is actually being used. As
I narrowed the test-case more and more, I was surprised by how little
it took to trigger it. The first patch in this series includes some
very basic tests for merge-tree, the last of which demonstrates the
regression.

The second patch implements the trivial fix for it.

This is the second version of the patch. The first version of the patch
included very trivial tests for merge-tree, which were really only
intended to demonstrate the breakage being fixed. This version of the
patch includes proper tests, with real "expected vs actual" testing,
rather than dumb "did it return successfully?" checks.

Will Palmer (2):
  add basic tests for merge-tree
  fix merge-tree where two branches share no changes

 builtin/merge-tree.c  |    3 +-
 t/t4300-merge-tree.sh |  277 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 279 insertions(+), 1 deletions(-)
 create mode 100755 t/t4300-merge-tree.sh

-- 
1.7.1.703.g42c01

             reply	other threads:[~2010-07-11 13:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-11 13:16 Will Palmer [this message]
2010-07-11 13:16 ` [PATCHv2 1/2] add basic tests for merge-tree Will Palmer
2010-07-13 23:31   ` Junio C Hamano
2010-07-14  7:01     ` Will Palmer
2010-07-14 16:26       ` Junio C Hamano
2010-07-11 13:16 ` [PATCHv2 2/2] fix merge-tree where two branches share no changes Will Palmer

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=1278854215-9022-1-git-send-email-wmpalmer@gmail.com \
    --to=wmpalmer@gmail.com \
    --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).