Re: [PATCH v3 12/16] refs/packed-backend.c: ignore complicated hidden refs rules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 14, 2023, 00:40 UTC
- Message-ID
- <xmqqo7li27ww.fsf@gitster.g>
- In-Reply-To
- <ca006b2c3f3474cdf7cfebbdb8575059e036d9cc.1686134440.git.me@ttaylorr.com>
Taylor Blau <me@ttaylorr.com> writes:
> In subsequent commits, we'll teach `receive-pack` and `upload-pack` to > use the new skip-list feature in the packed-refs iterator by ignoring
"skip" -> "jump".
Show 6 quoted lines
> references which are mentioned via its respective hideRefs lists. > > However, the packed-ref skip lists cannot handle un-hiding rules (that > begin with '!'), or namespace comparisons (that begin with '^'). Detect > and avoid these cases by falling back to the normal enumeration without > a skip list when such patterns exist.
Show 6 quoted lines
> + * We also can't feed any excludes from hidden refs > + * config sections, since later rules may override > + * previous ones. For example, with rules "refs/foo" and > + * "!refs/foo/bar", we should show "refs/foo/bar" (and > + * everything underneath it), but the earlier exclusion > + * would cause us to skip all of "refs/foo".
Good observation. The presence of !refs/foo/bar in hide list forbids us from adding refs/foo to the jump list, and it is the simplest to disable the whole jump list business when we have such a feature in use.
Makes sense. Thanks.