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, 03:51 UTC
Message-ID
<xmqqjzd540j1.fsf@gitster.g>
In-Reply-To
<CABPp-BGOLfeUn6H3cdeMf5tZ1gswoaR51J+PDhMB4akR3jG+LA@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
> ...  If the repository
> had a value for the replace ref before fast-import was run, and the
> replace ref was explicitly named in the fast-import stream, I don't
> want the replace ref to be left with a pre-fast-import value.

Ah, right. We want to honor the user's latest wish, i.e., if they create a replace ref that maps A to A, when they ask for object A, instead of returning it, we need to return what the replace ref refers to, which happens to be object A. So you are right. "You are trying to map A to A, so we'll ignore that request" is a wrong thing to do. "In order to give you A when you ask for A, we will remove the existing mapping for A" is absolutely the right thing to do, which is what your patch does.

Thanks.
Previous: Elijah NewrenNext: Elijah Newren
Message 5 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.