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

Re: Allowing weak references to blobs and strong references to commits

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2015, 20:23 UTC
Message-ID
<xmqq8uecrk5g.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150331100756.GA13377@glandium.org>
Mike Hommey <mh@glandium.org> writes:
> So I thought, since commits are already allowed in tree objects, for
> submodules, why not add a bit to the mode that would tell git that
> those commit object references are meant to always be there aka strong
> reference, as opposed to the current weak references for submodules.

Unless you are recording the paths to these "commits" to be potentially checked out on the filesystem, do not put them in a "tree". The entries in a tree object represent "This thing go to this path in the working tree".

It is not clear to me (and because you said "I won't bother you with all the whys and hows", I am guessing that it is OK for readers to be unclear), but I think you only want to make sure "git fetch" and "git push" transfers these objects, the graph formed by which is *not* any part of the main history of the project. It is perfectly OK to represent these objects as a special purpose history and have a ref point at its tip. The "notes" database is represented that way, for example. And I do not see anything wrong to use octopus merges in the history if you want to represent "here are the commit objects that I care about at this point in the 'special purpose' history (not the main history)".

Previous: Randall S. BeckerNext: Mike Hommey
Message 4 of 10 in “Allowing weak references to blobs and strong references to commits”
  1. Mike HommeyMar 31, 2015
  2. Philip OakleyMar 31, 2015
  3. Randall S. BeckerMar 31, 2015
  4. Junio C HamanoMar 31, 2015
  5. Mike HommeyMar 31, 2015
  6. Junio C HamanoMar 31, 2015
  7. Jonathan NiederMar 31, 2015
  8. Jonathan NiederMar 31, 2015
  9. Junio C HamanoMar 31, 2015
  10. Mike HommeyMar 31, 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.