git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] merge-recursive: symlink's descendants not in way

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Sep 20, 2019, 20:25 UTC
Message-ID
<20190920202506.74644-1-jonathantanmy@google.com>
In-Reply-To
<xmqqzhiyvqhe.fsf@gitster-ct.c.googlers.com>
Show 7 quoted lines
> 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
        )
 '
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “merge-recursive: symlink's descendants not in way”
  1. merge-recursive: symlink's descendants not in wayJonathan Tan, Sep 18, 2019
  2. Elijah NewrenSep 18, 2019
  3. Junio C HamanoSep 20, 2019
  4. Jonathan TanSep 20, 2019
  5. Junio C HamanoSep 20, 2019
  6. Jonathan TanSep 20, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.