From: Michael J Gruber <git@drmicha.warpmail.net>
To: James Pickens <james.e.pickens@intel.com>
Cc: git@vger.kernel.org, gitster@pobox.com, barvik@broadpark.no
Subject: Re: [PATCH 2/2] Demonstrate merge failure when a directory is replaced with a symlink.
Date: Wed, 29 Jul 2009 10:29:32 +0200 [thread overview]
Message-ID: <4A70086C.9070408@drmicha.warpmail.net> (raw)
In-Reply-To: <1248819198-13921-3-git-send-email-james.e.pickens@intel.com>
James Pickens venit, vidit, dixit 29.07.2009 00:13:
> This test creates two directories, a/b and a/b-2, replaces a/b-2 with a
> symlink to a/b, then merges that change into another branch that
> contains unrelated changes. Since the changes are unrelated, the merge
> should be free of conflicts, but 'git merge' gives a file/directory
> conflict.
>
> Note that this test is almost identical to t6035, except that instead of
> replacing a/b with a symlink, it replaces a/b-2 with a symlink. This
> test results in a merge conflict, whereas t6035 does not.
In fact they are identical: Exchange b for b-2 and vice versa everywhere
and you get the same test, except for the fact that in 1/2 you "test -f"
in the last step. But I'm sure that test fails at the merge step already
(because of a dirty worktree), doesn't it? You should see this when
running the test with -d/-v. (I'm guessing, I haven't run your test.)
>
> Signed-off-by: James Pickens <james.e.pickens@intel.com>
> ---
> t/t6036-merge-dir-to-symlink.sh | 30 ++++++++++++++++++++++++++++++
> 1 files changed, 30 insertions(+), 0 deletions(-)
> create mode 100755 t/t6036-merge-dir-to-symlink.sh
>
> diff --git a/t/t6036-merge-dir-to-symlink.sh b/t/t6036-merge-dir-to-symlink.sh
> new file mode 100755
> index 0000000..020db7c
> --- /dev/null
> +++ b/t/t6036-merge-dir-to-symlink.sh
> @@ -0,0 +1,30 @@
> +#!/bin/sh
> +
> +test_description='merging when a directory was replaced with a symlink'
> +. ./test-lib.sh
> +
> +test_expect_success setup '
> + mkdir -p a/b/c a/b-2/c &&
> + > a/b/c/d &&
> + > a/b-2/c/d &&
> + > a/x &&
> + git add -A &&
> + git commit -m base &&
> + rm -rf a/b-2 &&
> + ln -s b a/b-2 &&
> + git add -A &&
> + git commit -m "dir to symlink"
> +'
> +
> +test_expect_failure 'checkout should not delete a/b/c/d' '
> + git checkout -b temp HEAD^ &&
> + test -f a/b/c/d
> +'
> +
> +test_expect_failure 'merge should not have conflicts' '
> + echo x > a/x &&
> + git add a/x &&
> + git commit -m x &&
> + git merge master'
> +
> +test_done
As in 1/2, I think the first expect_failure leaves a dirty/unexpected
worktree (d missing) which causes the merge failure in the last step.
Michael
next prev parent reply other threads:[~2009-07-29 8:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-28 22:13 More symlink/directory troubles James Pickens
2009-07-28 22:13 ` [PATCH 1/2] Demonstrate bugs when a directory is replaced with a symlink James Pickens
2009-07-28 22:13 ` [PATCH 2/2] Demonstrate merge failure " James Pickens
2009-07-29 8:29 ` Michael J Gruber [this message]
2009-07-29 16:39 ` Pickens, James E
2009-07-29 8:19 ` [PATCH 1/2] Demonstrate bugs " Michael J Gruber
2009-07-29 8:33 ` Junio C Hamano
2009-07-29 16:57 ` Pickens, James E
2009-07-29 17:48 ` [PATCH v2] " Pickens, James E
2009-07-29 18:31 ` Junio C Hamano
2009-07-29 21:02 ` [PATCH v3] " Pickens, James E
2009-07-29 22:08 ` Linus Torvalds
2009-07-29 22:44 ` Junio C Hamano
2009-07-29 23:01 ` Kjetil Barvik
2009-07-29 23:58 ` Linus Torvalds
2009-07-30 1:06 ` Linus Torvalds
2009-07-30 3:26 ` Junio C Hamano
2009-07-30 6:05 ` Junio C Hamano
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=4A70086C.9070408@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=barvik@broadpark.no \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=james.e.pickens@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.