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

Re: [PATCH] combine-diff: handle --find-object in multitree code path

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 30, 2020, 22:07 UTC
Message-ID
<xmqqmu16gbqk.fsf@gitster.c.googlers.com>
In-Reply-To
<20200930115240.GA1899467@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
>  2. It doesn't catch all cases where a particular path is interesting.
>     Consider a merge with parent blobs X and Y for a particular path,
>     and end result Z. That should be interesting according to "-c",
>     because the result doesn't match either parent. And it should be
>     interesting even with "--find-object=X", because "X" went away in
>     the merge.
>
>     But because we perform each pairwise diff independently, this
>     confuses the intersection code. The change from X to Z is still
>     interesting according to --find-object. But in the other parent we
>     went from Y to Z, so the diff appears empty! That causes the
>     intersection code to think that parent didn't change the path, and
>     thus it's not interesting for "-c".
Hmmmm....
> +test_expect_success 'do not detect merge that does not touch blob' '
> +	git checkout -B merge interesting &&
> +	git merge -m "untouched blob" base &&
> +	git diff-tree --format=%s --find-object=$blob -c --name-status HEAD >actual &&
You learn new things every day ;-)

I've always thought that for --find-object to do a good job, you'd need "--full-history" and perhaps "-m". Especially, I didn't expect "-c" or "--cc" to make a difference.

Previous: Jeff KingNext: Jeff King
Message 4 of 5 in “combine-diff: handle --find-object in multitree code path”
  1. combine-diff: handle --find-object in multitree code pathJeff King, Sep 30, 2020
  2. Chris TorekSep 30, 2020
  3. Jeff KingSep 30, 2020
  4. Junio C HamanoSep 30, 2020
  5. Jeff KingSep 30, 2020

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.