git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Josh Triplett <josh@joshtriplett.org>
Cc: git@vger.kernel.org
Subject: Re: Properties of trees referencing commit objects (mode 160000)?
Date: Sun, 20 Mar 2016 00:18:04 -0400	[thread overview]
Message-ID: <20160320041803.GC18312@sigill.intra.peff.net> (raw)
In-Reply-To: <20160319221348.GA5247@x>

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

  reply	other threads:[~2016-03-20  4:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19 22:13 Properties of trees referencing commit objects (mode 160000)? Josh Triplett
2016-03-20  4:18 ` Jeff King [this message]
2016-03-20 18:45   ` Josh Triplett
2016-03-20 20:07     ` Jeff King
2016-03-20 23:22       ` Josh Triplett
2016-03-21  5:57         ` Jeff King
2016-03-21 15:36           ` Josh Triplett
2016-03-20 22:30     ` Junio C Hamano
2016-03-20 22:43       ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160320041803.GC18312@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=josh@joshtriplett.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).