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

Re: [PATCH] fetch/push: allow refs/*:refs/*

From
Junio C Hamano <gitster@pobox.com>
Date
May 7, 2012, 16:24 UTC
Message-ID
<7vobq06jt7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4FA4C2CC.7080205@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> This combination "!memcmp(ref->name, "refs/", 5) &&
> check_refname_format(ref->name, 0)" is the reason that I suggested
> adding a REFNAME_FULL option [1], in which case it could be written
> "check_refname_format(ref->name, REFNAME_FULL)".

I personally think that check-refname-format should lose its second parameter and always check for a concrete full refs, so that we can tighten the current allow-onelevel case a bit further (i.e. ".git/HEAD" is OK at the root level, but ".git/refs/heads/HEAD" is asking for trouble, and ".git/config" is downright confusing. The function does not get a good enough clue by only ONELEVEL). That would mean REFNAME_FULL will not be necessary---it should be the only mode of operation, and the callers need to be adjusted accordingly.

We should also introduce another function check-refspec-half-format to be used for the checks for left and right halves of refspec ("refs/heads/*" is OK but "refs/heads*" is not, perhaps).

A single function trying to do both and not doing a good job in either case is not a pretty picture.

Previous: Michael HaggertyNext: Michael Haggerty
Message 8 of 10 in “[BUG] "fetch $there +refs/*:refs/*" fails if there is a stash”
  1. Junio C HamanoMay 1, 2012
  2. Michael HaggertyMay 2, 2012
  3. Junio C HamanoMay 2, 2012
  4. fetch/push: allow refs/*:refs/*Junio C Hamano, May 4, 2012
  5. get_fetch_map(): tighten checks on dest refsJunio C Hamano, May 4, 2012
  6. Michael HaggertyMay 5, 2012
  7. Michael HaggertyMay 5, 2012
  8. Junio C HamanoMay 7, 2012
  9. Michael HaggertyMay 15, 2012
  10. Junio C HamanoMay 15, 2012

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.