Boost logo

Boost :

Subject: Re: [boost] Git: maintaining super-project
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2013-12-05 08:54:13


Andrey Semashev <andrey.semashev_at_[hidden]> writes:

> On Wed, Dec 4, 2013 at 12:06 PM, Vladimir Prus <ghost_at_[hidden]> wrote:
>> On 04.12.2013 11:32, Andrey Semashev wrote:
>>
>>> I just checked out the super-project:
>>>
>>> git clone --recursive http://github.com/boostorg/boost.git
>>> modular-boost
>>>
>>> It actually said:
>>>
>>> Submodule path 'libs/program_options': checked out
>>> 'fb4f36f3eecbef1e3b4ace5b263e01d56e42d5c7'
>>>
>>> But after these commands I saw the newer revisions:
>>>
>>> cd modular-boost/libs/program_options
>>> git checkout master
>>> Switched to branch 'master'
>>>
>>> git log -1
>>> commit 9d7c9875265ec7fec03aabf18e3d53c3e5e1a46c
>>> Author: Vladimir Prus <vladimir_at_[hidden]>
>>> Date: Wed Dec 4 09:17:17 2013 +0400
>>>
>>> Remove tabs.
>>>
>>> I'm not sure what the "Submodule" line means, but it seems the
>>> repository is cloned with the newer revisions.
>
> man git-submodule says that the submodule involves something called
> "gitlink", which refers to the particular revision. I don't know what
> this is but is it possible to specify HEAD instead of the specific
> revisions in gitlinks?

It's not possible. Git submodules were purposely designed to only let
you link to a specific revision. This is A Good Thing and different
from how svn:externals work.

The reason for fixed revision links is that a particular commit in the
super project is then a snapshot of the entire source tree, submodules
and everything. If you could link to a submodule HEAD it would never be
possible to get a stable snapshot of superproject commit
blah023blah034blah093blah because the source of the submodule may have
changed since blah023blah034blah093blah was committed. In short, a
dependency nightmare.

Git submodules make it very explicit what was intended to link to what.
If you want to change the linkage you have to do it _explicitly_ by
committing an updated submodule link. That way noone is left confused
about what the commit author really intended.

Yes, this confused me horribly when I started using git too. Now I
can't imagine why I ever wanted it otherwise.

Alex

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk