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

Re: [PATCH 0/6] Improved infrastructure for refname normalization

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Sep 10, 2011, 03:31 UTC
Message-ID
<4E6ADA23.4010800@alum.mit.edu>
In-Reply-To
<7vzkidtx81.fsf@alter.siamese.dyndns.org>
On 09/09/2011 07:57 PM, Junio C Hamano wrote:
> By the way, does this series introduce new infrastructure features that
> can be reused in different areas, such as Hui's "alt_odb path
> normalization" patch?
That code is for normalizing filesystem paths, right?

The rules for normalizing filesystem paths are similar to those for refnames (except maybe for stripping the leading "/"). But the validity checks are different, and should be kept separate in case some of the rules need to be tweaked. Since I put the code for validity checks and normalization of refnames in a single function, I don't think it makes sense to share code.

It would be possible to separate the validity checks from the normalization, but that would require two scans of the refname. And I think it should be considered rather an accident that filesystem names and refnames have similar conventions (even though there is a strong historical reason for the similarity); they could some day diverge if, say, we started adding support for Windows-native paths.

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Junio C Hamano
Message 13 of 13 in “Improved infrastructure for refname normalization”
  1. 0/6 Improved infrastructure for refname normalizationMichael Haggerty, Sep 9, 2011
  2. 1/6 Change bad_ref_char() to return a boolean valueMichael Haggerty, Sep 9, 2011
  3. 2/6 git check-ref-format: add options --onelevel-ok and --refname-patternMichael Haggerty, Sep 9, 2011
  4. 3/6 Change check_ref_format() to take a flags argumentMichael Haggerty, Sep 9, 2011
  5. 4/6 Add a library function normalize_refname()Michael Haggerty, Sep 9, 2011
  6. 5/6 Do not allow ".lock" at the end of any refname componentMichael Haggerty, Sep 9, 2011
  7. 6/6 Add a REFNAME_ALLOW_UNNORMALIZED flag to check_ref_format()Michael Haggerty, Sep 9, 2011
  8. Junio C HamanoSep 9, 2011
  9. Michael HaggertySep 10, 2011
  10. A Large Angry SCMSep 9, 2011
  11. Michael HaggertySep 9, 2011
  12. Junio C HamanoSep 9, 2011
  13. Michael HaggertySep 10, 2011

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.