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

Re: RefTree: Alternate ref backend

From
MFMartin Fick <mfick@codeaurora.org>
Date
Dec 22, 2015, 20:56 UTC
Message-ID
<6263203.WlZuyGWxlh@mfick1-lnx>
In-Reply-To
<4689734.cEcQ2vR0aQ@mfick1-lnx>
On Tuesday, December 22, 2015 06:17:28 PM you wrote:
> On Tue, Dec 22, 2015 at 7:41 AM, Michael Haggerty
<mhagger@alum.mit.edu> wrote:
Show 14 quoted lines
>
> At a deeper level, the "refs/" part of reference names is
> actually pretty useless in general. I suppose it
> originated in the practice of storing loose references
> under "refs/" to keep them separate from other metadata
> in $GIT_DIR. But really, aside from slightly helping
> disambiguate references from paths in the command line,
> what is it good for? Would we really be worse off if
> references' full names were
>
>     HEAD
>     heads/master
>     tags/v1.0.0
>     remotes/origin/master (or remotes/origin/heads/master)
I think this is a bit off, because
  HEAD != refs/HEAD
so not quite useless.

But, I agree that the whole refs notation has always bugged me, it is quirky. It makes it hard to disambiguate when something is meant to be absolute or not. What if we added a leading slash for absolute references? Then I could do something like:

/HEAD /refs/heads/master /refs/tags/v1.0.0 /refs/remotes/origin/master

I don't like that plumbing has to do a dance to guess at expansions, how many tools get it wrong (do it in different orders, miss some expansions...). With an absolute notation, plumbing could be built to require absolute notations, giving more predictable interpretations when called from tools.

This is a long term idea, but it might make sense to consider it now just for the sake of storing refs, it would eliminate the need for the ".." notation for "refs/..HEAD".

Now if we could only figure out a way to tell plumbing that something is a SHA, not a ref? :)

-Martin

-- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 18 in “RefTree: Alternate ref backend”
  1. Shawn PearceDec 17, 2015
  2. Junio C HamanoDec 17, 2015
  3. Shawn PearceDec 17, 2015
  4. Jeff KingDec 17, 2015
  5. Shawn PearceDec 17, 2015
  6. Mike HommeyDec 18, 2015
  7. Michael HaggertyDec 22, 2015
  8. Shawn PearceDec 22, 2015
  9. Dave BorowitzDec 22, 2015
  10. Michael HaggertyDec 22, 2015
  11. Shawn PearceDec 22, 2015
  12. Junio C HamanoDec 22, 2015
  13. Shawn PearceDec 22, 2015
  14. Junio C HamanoDec 22, 2015
  15. Michael HaggertyDec 23, 2015
  16. Junio C HamanoDec 24, 2015
  17. Martin FickDec 22, 2015
  18. Junio C HamanoDec 22, 2015

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.