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

Re: [PATCH] fast-import: avoid making replace refs point to themselves

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 15, 2024, 01:08 UTC
Message-ID
<xmqqv7wp483v.fsf@gitster.g>
In-Reply-To
<xmqqzfm149sv.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> I am not sure if a warning is even warranted.  If you decide to
> replace an object A with the same object A, the result ought to be a
> no-op.  I wonder if it is makes more sense to
>
>  (1) do this unconditionally and silently, and
>  (2) when we prepare the replace_map, ignore self-referencing ones.
>
> instead.  If (2) makes sense entirely depends on the answer of an
> earlier question (i.e. "is there a reason why self-reference is more
> common than general loop?").

Forgot to add. (1) could be done even at a lower layer, i.e. the ref API could be told to reject such a replace ref creation/update that maps an object name to itself.

Previous: Junio C HamanoNext: Elijah Newren
Message 3 of 8 in “fast-import: avoid making replace refs point to themselves”
  1. fast-import: avoid making replace refs point to themselvesElijah Newren via GitGitGadget, Nov 14, 2024
  2. Junio C HamanoNov 15, 2024
  3. Junio C HamanoNov 15, 2024
  4. Elijah NewrenNov 15, 2024
  5. Junio C HamanoNov 15, 2024
  6. Elijah NewrenNov 15, 2024
  7. fast-import: avoid making replace refs point to themselvesElijah Newren via GitGitGadget, Nov 18, 2024
  8. Junio C HamanoNov 19, 2024

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.