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

Re: [PATCH 1/1] worktree refs: fix case sensitivity for 'head'

From
Duy Nguyen <pclouds@gmail.com>
Date
Dec 14, 2018, 17:46 UTC
Message-ID
<CACsJy8COqOMEk3Wzr==1-hsuGqdgKnbNfG_c90+xpU_oS-bW6A@mail.gmail.com>
In-Reply-To
<CACsJy8CT8K9SHnTsJT4HrxAK95yTz-x2DnNRBYKkvMyGbBZCgg@mail.gmail.com>
On Fri, Dec 14, 2018 at 6:38 PM Duy Nguyen <pclouds@gmail.com> wrote:
Show 20 quoted lines
>
> On Fri, Dec 14, 2018 at 6:22 PM Jacob Keller <jacob.keller@gmail.com> wrote:
> >
> > On Thu, Dec 13, 2018 at 11:38 PM Duy Nguyen <pclouds@gmail.com> wrote:
> > > Even with a new ref storage, I'm pretty sure pseudo refs like HEAD,
> > > FETCH_HEAD... will forever be backed by filesystem. HEAD for example
> > > is part of the repository signature and must exist as a file. We could
> > > also lookup pseudo refs with readdir() instead of lstat(). On
> > > case-preserving-and-insensitive filesystems, we can reject "head" this
> > > way. But that comes with a high cost.
> > > --
> > > Duy
> >
> > Once other refs are backed by something that doesn't depend on
> > filesystem case sensitivity, you could enforce that we only accept
> > call-caps HEAD as a psuedo ref, and always look up other spellings in
> > the other refs backend, though, right?
>
> Hmm.. yes. I don't know off hand if we have any pseudo refs in
> lowercase. Unlikely so yes this should work.

One thing we could do _today_ without waiting for a new refs backend is, avoid looking up pseudo refs if the given ref name is not all-caps. So "head" (or hEAd) can match refs/head, refs/tags/head, refs/heads/head but never $GIT_DIR/HEAD. And yes I checked the code, pseudo refs must be all-caps.

-- 
Duy
Previous: Duy NguyenNext: Jacob Keller
Message 13 of 18 in “worktree refs: fix case sensitivity for 'head'”
  1. 0/1 worktree refs: fix case sensitivity for 'head'Michael Rappazzo via GitGitGadget, Dec 13, 2018
  2. 1/1 worktree refs: fix case sensitivity for 'head'Michael Rappazzo via GitGitGadget, Dec 13, 2018
  3. Duy NguyenDec 13, 2018
  4. Mike RappazzoDec 13, 2018
  5. Duy NguyenDec 13, 2018
  6. Stefan BellerDec 13, 2018
  7. Mike RappazzoDec 13, 2018
  8. brian m. carlsonDec 14, 2018
  9. Jacob KellerDec 14, 2018
  10. Duy NguyenDec 14, 2018
  11. Jacob KellerDec 14, 2018
  12. Duy NguyenDec 14, 2018
  13. Duy NguyenDec 14, 2018
  14. Jacob KellerDec 14, 2018
  15. Jacob KellerDec 14, 2018
  16. Mike RappazzoDec 13, 2018
  17. Junio C HamanoDec 14, 2018
  18. Johannes SchindelinDec 14, 2018

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.