[KyOSS Discuss] Git Submodules Question...

Jeff Squyres jeff at squyres.com
Thu Mar 19 09:01:39 EDT 2015


In short: updating the sub modules is always a deliberate action. 

Sent from my phone. No type good. 

> On Mar 18, 2015, at 2:08 PM, alan blount <alan at zeroasterisk.com> wrote:
> 
> I realized my last email wasn't super clear:
> 
> parent: (hash123)
>  - submodule a: (hash99)
>  - submodule b: (hash3333)
> 
> then you can do some work and end up at:
> 
> parent: (hash1234)
>  - submodule a: (hash99)
>  - submodule b: (hash3333)
> 
> no changes to submodules....
> 
> but, perhaps you decide you want to get the latest version of "submodule a"
> 
> $ cd <parent>
> $ cd <submodule a>
> $ git checkout master
> $ git pull --rebase
> $ cd <parent>
> $ git commit -a -m "updated submodule a"
> 
> parent: (hash1235)
>  - submodule a: (hash100)
>  - submodule b: (hash3333)
> 
> 
> 
> 
>> On Wed, Mar 18, 2015 at 5:04 PM alan blount <alan at zeroasterisk.com> wrote:
>> I'm a fan of submodules - we use them at work... 
>> 
>> git has some new fangldy sub-tree which is supposed to work better, but we've been comfortable with submodules so we have not investigated.
>> 
>> I agree, a commit on the "parent" repo always relates to a single hash for each submodule it contains... so you can't get latests on every one of them....  and you wouldn't want to (because that other repo might totally change their API and now your app doesn't work between different checkouts of the same parent-repo-hash)
>> 
>> If you want to get latest on all of them, it's approx the following for every submodule:
>> 
>> $ cd <path-of-repo>; git checkout master; git pull --rebase; cd ..;
>> 
>> ... then commit your changes (updated hashes) on the parent repo.
>> 
>> As for checking them all out, it should be really easy... here's the shortcut I use:
>> 
>> $ git clone --recursive <path>
>> 
>> or if already git repo, existing submodules and new ones alike can be updated to where they should be (for the current commit of the parent repo):
>> 
>> $ git submodule update --init --recursive
>> 
>> 
>> 
>> good enough?
>> 
>>> On Wed, Mar 18, 2015 at 4:32 PM Deven Phillips <deven.phillips at gmail.com> wrote:
>>> Does that mean that the place where a submodule points to can be modified on a per-commit level? For example:
>>> 
>>> commit 1 -> submodule commit 15
>>> 
>>> ..... do some work
>>> 
>>> commit 2 -> submodule commit 27
>>> 
>>> etc....
>>> 
>>> Deven
>>> _______________________________________________
>>> KyOSS-Discuss mailing list
>>> KyOSS-Discuss at kyoss.org
>>> Subscribe by sending email to kyoss-discuss-subscribe at kyoss.org
>>> Unsubscribe by sending email (from the address you wish to unsubscribe) to kyoss-discuss-unsubscribe at kyoss.org
>>> Difficulty unsubscribing? Check your email headers for originally-to address in case you are forwarding your mail.
>>> More options at http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
> _______________________________________________
> KyOSS-Discuss mailing list
> KyOSS-Discuss at kyoss.org
> Subscribe by sending email to kyoss-discuss-subscribe at kyoss.org
> Unsubscribe by sending email (from the address you wish to unsubscribe) to kyoss-discuss-unsubscribe at kyoss.org
> Difficulty unsubscribing? Check your email headers for originally-to address in case you are forwarding your mail.
> More options at http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kyoss.org/pipermail/kyoss-discuss/attachments/20150319/a083e92d/attachment.html>


More information about the KyOSS-Discuss mailing list