Re: [PATCH 2/2] ref-filter: support filtering of operational refs
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 2, 2024, 18:49 UTC
- Message-ID
- <ZZRayoauM6s5XUFR@nand.local>
- In-Reply-To
- <ZY1PLtPue4PgbhwU@tanuki>
On Thu, Dec 28, 2023 at 11:34:22AM +0100, Patrick Steinhardt wrote:
Show 7 quoted lines
> One interesting question is how we should treat files that look like a > pseudoref, but which really aren't. I'm not aware of any such files > written by Git itself, but it could certainly be that a user wrote such > a file into the repository manually. But given that we're adding new > behaviour that will be opt-in (e.g. via a new switch) I'd rather err on > the side of caution and mark any such file as broken instead of silently > ignoring them.
I probably wouldn't spend a ton of time worrying about this personally. Without additional information, I think it's impossible for us to determine a-priori whether or not a file underneath $GIT_DIR should be interpreted as a pseudo-ref or not.
I agree with your reasoning that since this is opt-in via a new command-line flag, that we're probably OK here enumerating the files in $GIT_DIR, and printing out the ones that look like pseudo-refs.
Thanks, Taylor