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
Jacob Keller <jacob.keller@gmail.com>
Date
Dec 14, 2018, 17:22 UTC
Message-ID
<CA+P7+xoxE0o=5fMQrDoyCgWMQ-By2t1LdApecRDWmoXXCfnFuw@mail.gmail.com>
In-Reply-To
<CACsJy8D9qfBLOUCyca+ws66uHx_tgoFZSTbTBxxW2fRQmyr_Nw@mail.gmail.com>
On Thu, Dec 13, 2018 at 11:38 PM Duy Nguyen <pclouds@gmail.com> wrote:
Show 8 quoted lines
> 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? So, yea the actual file may not be case sensitive, but we would never create refs/head anymore for any reason, so there would be no ambiguity if reading the refs/head vs refs/HEAD on a case insensitive file system, since refs/head would no longer be a legitimate ref stored as a file if you used a different refs backend.

Basically, we'd be looking up HEAD by checking the file, but we'd stop looking up head, hEAd, etc in the files, and instead use whatever other refs backend for non-pseudo refs. Thus, it wouldn't matter, since we'd never actually lookup the other spellings of HEAD as a file. Wouldn't that solve the ambiguity, at least once a repository has fully switched to some alternative refs backend for non-pseudo refs? (Unless I mis-understand and refs/head could be an added pseudo ref?)

Jake
Previous: Duy NguyenNext: Duy Nguyen
Message 11 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.