All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: gitster@pobox.com
Cc: jonathantanmy@google.com, git@vger.kernel.org, newren@gmail.com,
	szeder.dev@gmail.com
Subject: Re: [PATCH v2] merge-recursive: symlink's descendants not in way
Date: Fri, 20 Sep 2019 13:25:06 -0700	[thread overview]
Message-ID: <20190920202506.74644-1-jonathantanmy@google.com> (raw)
In-Reply-To: <xmqqzhiyvqhe.fsf@gitster-ct.c.googlers.com>

> OK.  We notice that we need to newly create foo/bar but we
> incorrectly find that there is "foo/bar" already because of the
> careless use of bare lstat(2) makes "bar" visible as if it were also
> "foo/bar".  I wonder if the current code would be confused the same
> way if the side branch added "foo/bar/file", or the confusion would
> be even worse---it is not dir_in_way() and a different codepath
> would be affected, no?

I don't think there is a different codepath to be affected - as far as I
can tell, dir_in_way() is the only cause (at least of this particular
error). I've tested this case [1] and the current code actually works -
as you said, dir_in_way() will not report anything in the way (since
foo/bar/file doesn't exist in the working tree), so the merge will
happen as expected.

> Nicely done.  Thanks, will queue.

Thanks.

[1]
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index faa8892741..f284aeb173 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -468,15 +468,16 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
                git checkout master &&
                git rm foo &&
                mkdir foo &&
-               >foo/bar &&
-               git add foo/bar &&
-               git commit -m "replace foo symlink with real foo dir and foo/bar file" &&
+               mkdir foo/bar &&
+               >foo/bar/baz &&
+               git add foo/bar/baz &&
+               git commit -m "replace foo symlink with real foo dir and foo/bar/baz file" &&
 
                git checkout branch1 &&
 
                git cherry-pick master &&
                test_path_is_dir foo &&
-               test_path_is_file foo/bar
+               test_path_is_file foo/bar/baz
        )
 '


  reply	other threads:[~2019-09-20 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <https://public-inbox.org/git/20190917215040.132503-1-jonathantanmy@google.com/>
2019-09-18 20:27 ` [PATCH v2] merge-recursive: symlink's descendants not in way Jonathan Tan
2019-09-18 21:54   ` Elijah Newren
2019-09-20 17:15   ` Junio C Hamano
2019-09-20 20:25     ` Jonathan Tan [this message]
2019-09-20 20:38       ` Junio C Hamano
2019-09-20 20:50         ` Jonathan Tan

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=20190920202506.74644-1-jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=szeder.dev@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.
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.