Re: check-ref-format: include refs/ in the argument or to strip it?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 25, 2014, 19:01 UTC
- Message-ID
- <xmqqzjesl7gk.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAL=YDWk5FxnNWaFXJk3t+H0Q_axETmNeb=puuUqhiDBNeQVDGQ@mail.gmail.com>
Ronnie Sahlberg <sahlberg@google.com> writes:
> There are also a lot of places where we assume that a refs will start > with "refs/heads/" and not just "refs/" > for_each_branch_ref(), log_ref_setup() (so no reflogs) is_branch() to > name a few.
for-each-BRANCH-ref and is-BRANCH are explicitly about branches and it is natural that they will work only on refs that start with refs/heads/, no? I am not sure about log-ref-setup ("git grep pu" does not find it).
> This makes the api a bit confusing and hard to predict. Which > functions allow refs/foo and which will ignore it? Are there any > compelling reasons why refs/foo should be allowed?
The only one I can think of offhand that we internally use is the stash, but that does not give us any assurance that no third-party tool is using refs/frotz for its own use X-<.