On Wed, Jun 21, 2023 at 07:35:09PM +0000, John Cai via GitGitGadget wrote: > The ref_excludes API is used to tell which refs should be excluded. However, > there are times when we would want to add refs to explicitly include as > well. 4fe42f326e (pack-refs: teach pack-refs --include option, 2023-05-12) > taught pack-refs how to include certain refs, but did it in a more manual > way by keeping the ref patterns in a separate string list. Instead, we can > easily extend the ref_excludes API to include refs as well, since this use > case fits into the API nicely. After reading this description, I am not sure why you can't "include" a reference that would otherwise be excluded by passing the rules: - refs/heads/exclude/* - !refs/heads/exclude/but/include/me (where the '!' prefix in the last rule is what brings back the included reference). But let's read on and see if there is something that I'm missing. > Refactor the API by renaming it to ref_visibility, and add a ref_visible() > helper that takes into account ref inclusion. Hmm. Is this a replacement for ref_is_hidden(), which is already public? Thanks, Taylor