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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Josh Triplett <josh@xxxxxxxxxxxxxxxx> writes:

> On Sun, Mar 20, 2016 at 12:18:04AM -0400, Jeff King wrote:
>> 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 clone/checkout/etc handle it properly in that case, in the
> absence of a .gitmodules file?  Or would it only work with custom tools?

That depends on the definition of "proper".  The default "proper"
way for the core Git for submodules/gitlinks is to create an empty
directory.  If you want to populate a working tree for that, you'd
need "git submodule" support, but because you are writing "some
tools" on your own, there probably is a reason why you do not want
to use "git submodule", so I am guessing that your definition of
"proper" does not match either core Git or "git submodule" considers
"proper"?  In which case you would need to implement your own
semantics (you may not even want to have an empty directory there,
for example).


>> 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).
>
> Argh.  If I have a pile of disconnected commits, is there anything git
> *would* follow to see them, other than a pile of refs?

No.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]