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

Re: [ANNOUNCE] Git v2.44.0

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 27, 2024, 07:02 UTC
Message-ID
<Zd2JBk7JWEGENAiu@tanuki>
In-Reply-To
<xmqqbk84jwfy.fsf@gitster.g>
On Sun, Feb 25, 2024 at 09:16:49AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > That's ultimately the reason why I don't want HEAD to look like a proper
> > ref. But doing the "refs/heads/.invalid" workaround shouldn't be too bad,
> > I guess.
> 
> Isn't the reason why reftable backend initializes refs/heads to be a
> regular file exactly because we want to reject an attempt to create
> such a file on the filesystem, though?

Yeah, "refs/heads" being a file is also part of this mechanism. But that wouldn't help a client that e.g. uses git-symbolic-ref(1) while assuming the old "files" backend, because they would now get a plausible value of whatever value we have in there if we were to initialize it e.g. with "refs/heads/main".

That's why we have both mechanisms -- it's a bit like defense in depth. One could go even further and make "HEAD" contain complete garbage, only, so that anybody who was trying to read it would fail immediately.

Patrick
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 7 of 8 in “[ANNOUNCE] Git v2.44.0”
  1. Junio C HamanoFeb 23, 2024
  2. Mike HommeyFeb 24, 2024
  3. Patrick SteinhardtFeb 24, 2024
  4. Mike HommeyFeb 24, 2024
  5. Patrick SteinhardtFeb 25, 2024
  6. Junio C HamanoFeb 25, 2024
  7. Patrick SteinhardtFeb 27, 2024
  8. Patrick SteinhardtFeb 27, 2024

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.