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

Re: BUG?: xdl_merge surprisingly does not recognize content conflict

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2019, 16:51 UTC
Message-ID
<xmqqh86h12au.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190815220303.17209-1-newren@gmail.com>
Elijah Newren <newren@gmail.com> writes:
> Now, a manual merge of these files gives no conflicts, which surprises me:
>
>   $ git merge-file ours base theirs; echo $?
>   0
Indeed that is surprising.
Show 12 quoted lines
> -- 8< --
> Subject: checkout: remove duplicate code
>
> Both commit a7256debd4b6 ("checkout.txt: note about losing staged
> changes with --merge", 2019-03-19) from nd/checkout-m-doc-update and
> commit 6eff409e8a76 ("checkout: prevent losing staged changes with
> --merge", 2019-03-22) from nd/checkout-m were included in git.git
> despite the fact that the latter was meant to be v2 of the former.
> The merge of these two topics resulted in a redundant chunk of code;
> remove it.
>
> Signed-off-by: Elijah Newren <newren@gmail.com>

The latter half that you remove cannot be reached, because the first half would have already died after checking the same condition, so we were doing the same repo-index-has-changes check twice when there is no change; in other words, we were lucky that this accidental dup did not cause any real damange.

Thanks for spotting.  Will apply.
Previous: Elijah NewrenNext: Elijah Newren
Message 3 of 5 in “BUG?: xdl_merge surprisingly does not recognize content conflict”
  1. Elijah NewrenAug 15, 2019
  2. Elijah NewrenAug 15, 2019
  3. Junio C HamanoAug 16, 2019
  4. Elijah NewrenAug 16, 2019
  5. Jeff KingAug 16, 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.