git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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-<.

Previous: Michael HaggertyNext: Jonathan Nieder
Message 10 of 11 in “check-ref-format: include refs/ in the argument or to strip it?”
  1. Jonathan NiederAug 22, 2014
  2. Junio C HamanoAug 22, 2014
  3. Jonathan NiederAug 22, 2014
  4. Jeff KingAug 23, 2014
  5. Junio C HamanoAug 23, 2014
  6. Ronnie SahlbergAug 25, 2014
  7. Jonathan NiederAug 25, 2014
  8. Jeff KingAug 25, 2014
  9. Michael HaggertyAug 27, 2014
  10. Junio C HamanoAug 25, 2014
  11. Jonathan NiederAug 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.