Thread (7 messages) 7 messages, 2 authors, 2016-06-15

Re: Properties of trees referencing commit objects (mode 160000)?

flat view

From: Jeff King <hidden>
Date: 2016-06-15 23:08:50

On Sat, Mar 19, 2016 at 03:13:48PM -0700, Josh Triplett wrote:
I'm building some tools to track commit objects, and I'm thinking of
using submodule-style references to commit objects in tree objects (mode
160000) to do so.  I'm trying to figure out some of the properties of
that.

Can a commit object referenced that way live in the same repository,
rather than some external repository?
Yes, it can be in the same repository, but...
Will git treat such a reference as keeping the commit object (and
everything recursively referenced by it) live and reachable?  If that
commit object is only reachable by the tree, and not by following the
parents of any commit directly referenced from refs/*, will git discard
it as unreachable?
No, we do not follow "gitlinks" like this for reachability. Neither for
pruning, nor for object transfer via push/fetch. So you'd need to have a
separate reference to it (or history containing it).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help