Re: "git symbolic-ref" doesn't do a very good job
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 31, 2022, 19:10 UTC
- Message-ID
- <xmqqzggpyu7q.fsf@gitster.g>
- In-Reply-To
- <YuXKaLXhnR3mVlWk@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> I'm tempted to say that the symref-reading code should > actually complain about following something outside of "refs/", but that > carries an even higher possibility of breaking somebody. But it seems > like we should be consistent between what we allow to be read, and what > we allow to be written. > > At any rate, with the code as you have it above, I think the "make sure > HEAD starts with refs/" code is now redundant.
Isn't the rule these days "HEAD must be either detached or point into refs/heads/"? I thought "checkout" ensures that, and I am tempted to think that "symbolic-ref" that works on HEAD should be consistent with "checkout". So "make sure HEAD is within refs/" would certainly be "not wrong per-se" but not sufficiently tight, I suspect.