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

Re: RefTree: Alternate ref backend

From
Shawn Pearce <spearce@spearce.org>
Date
Dec 22, 2015, 19:11 UTC
Message-ID
<CAJo=hJswuPdLT0KtGdf_=UGxD7-5NjGk2mwFjRU=uYb-Su-y+A@mail.gmail.com>
In-Reply-To
<xmqq1taee1w9.fsf@gitster.mtv.corp.google.com>
On Tue, Dec 22, 2015 at 11:09 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Shawn Pearce <spearce@spearce.org> writes:
>
>>> But really, aside from slightly helping
>>> disambiguate references from paths in the command line, what is it good
>>> for?
>>
>> Nothing really; today refs/ prefix is used to encourage to the tools
>> that you really meant refs/heads/master and not
>> refs/heads/heads/master or some other crazy construct. You can thank
>> the DWIMery inside the ref rev parse logic for needing this.
>
> Aren't you two forgetting one minor thing, though?
>
> A layout without refs/, i.e. $GIT_DIR/{heads,tags,...}, will force
> us to keep track of where the tips of histories are anchored for
> reachability purposes, every time you would add a new hierarchy
> (e.g. $GIT_DIR/changes)--and those unfortunate souls who run a
> slightly older version of Git that is unaware of 'changes' hierarchy
> would weep after running "git gc", no?
You still store them under refs/

All of the code that is handed a ref name knows its a ref name and not a sha-1 object name in the objects directory.

The catch is a few things accept HEAD, MERGE_HEAD, FETCH_HEAD, etc. Those have to be handled even though they aren't in the refs/ directory.

Previous: Junio C HamanoNext: Junio C Hamano
Message 13 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.