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.