Re: [PATCH v2 7/8] packed-backend: check whether the "packed-refs" is sorted
- From
shejialuo <shejialuo@gmail.com>
- Date
- Feb 1, 2025, 09:50 UTC
- Message-ID
- <Z53uT8BnepXEjv8v@ArchLinux>
- In-Reply-To
- <xmqqed0j9clh.fsf@gitster.g>
On Fri, Jan 31, 2025 at 08:23:22AM -0800, Junio C Hamano wrote:
Show 21 quoted lines
> shejialuo <shejialuo@gmail.com> writes: > > > On Thu, Jan 30, 2025 at 11:02:18AM -0800, Junio C Hamano wrote: > >> shejialuo <shejialuo@gmail.com> writes: > >> > >> > We will always try to sort the "packed-refs" increasingly by comparing > >> > the refname. So, we should add checks to verify whether the "packed-refs" > >> > is sorted. > >> > >> Do this _ONLY_ when the packed-refs file has a header that declares > >> "sorted" trait. Insisting on a packed-refs file that does not would > >> mean you are stricter than the runtime contract allows. > >> > > > > From my perspective, we should check whether it is sorted when the > > header has a "sorted" trait. > > So the three-lines you wrote is not accurate, then. That is why I > said that "should add checks" should not be unconditional---we > should not check if the file contents is sorted when "sorted" trait > is not declared.
I have made confusion here. Sorry. Let me improve this in the next version.
Thanks, Jialuo