git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Frawley, Sarah" <sarah.frawley@intel.com>
To: Heiko Voigt <hvoigt@hvoigt.net>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: RE: FW: Query on git submodules
Date: Tue, 2 Jun 2015 14:22:55 +0000	[thread overview]
Message-ID: <4C328B7D13677A4EAF715D0755A6D7EE25C60153@irsmsx110.ger.corp.intel.com> (raw)
In-Reply-To: <20150602111219.GA7442@book.hvoigt.net>

Thanks for getting back to me Heiko

To comment on the below.  Adding some automated way of setting a relative path via git submodule add would be really useful.
Is this something that is possible in a new git release?

As regards using the command below.
git submodule update --init --recursive
We use this already however it just refreshes any submodule changes that have been pushed to git.  
What I am looking for is a way to re-align submodule tags to new tags across a large hierarchy.

See example below.  It show a simple submodule hierarchy.  You can see that the 'c_block' occurs underneath both the 'e' and the 'd' blocks and they are both set to the same tag (tag_1).  If I decide to create a new tag for 'c_block' called tag_2 in order for both d_block and e_block to pick it up I will need to make a update to both blocks where I check out the tag_2 for 'd/e_blocks' and commit, push and tag and make another change to 'a_block' so that it checks out the new tags for 'c_block','d_block' and 'e_block'.  This all happens manually in my team currently.  Sometimes there is a need to roll out the same change to all repos and for the hierarchy to be up rev'd to the latest tag for every submodule so a script for this case would be useful.  It would be nice to be able to have a script read in a list of tags for update across the hierarchy.

a_block   ->  c_block (tag_1)    ->   d_block(tag_4)     

                     d_block (tag_4)     ->  c_block(tag_1)    

	       e_block (tag_8)      -> d_block(tag_4)     
                                                          c_block(tag_1)    

Commandline use to update e_block to pick up new tag for c_block:
cd e_block/submodules/c_block
git checkout tag_2
cd ../..
git commit
git push
git tag



git submodule update --init --recursive


Thanks,
Sarah Frawley
Quark DA

To raise a DA help ticket please file using the url below: https://hsdes.intel.com/home/default.html#article?&subject=support&tenant=quark

-----Original Message-----
From: Heiko Voigt [mailto:hvoigt@hvoigt.net] 
Sent: Tuesday, June 2, 2015 12:12 PM
To: Frawley, Sarah
Cc: git@vger.kernel.org
Subject: Re: FW: Query on git submodules

On Wed, May 27, 2015 at 01:20:11PM +0000, Frawley, Sarah wrote:
> Thanks Heiko for getting back to me.
> 
> Correct when I referred to 10+ layers I meant nested repositories 
> which make up a large hierarchy.  Some repositories are repeated 
> across the hierarchy.  We check-out submodules to tag versions (as 
> opposed to master branch).  If we need to roll out a particular change 
> across a hierarchy (e.g. 60 repos) then every level in the hierarchy 
> needs to pick up new submodule tags.
> 
> The main 2 issues that we see are:
> 
> 1. Enforcement of absolute paths in git submodules - I am currently 
> trialing using a pre-commit hook to highlight this issue to users so 
> that they can fix their submodule urls to relative paths.

So you mean, enforcement of relative paths. Right? It might be a good idea to put some code in 'git submodule add' that would automatically use a relative path instead of absolute path if it can calculate one from the superproject. I think that would help your users even more as they do not get an error from the pre-commit hook, but just having everything right after doing the add.

If you want to go that route it should not be that much different from the hook, since the submodule subcommand code is all bash.

> 2. Slowness Integrating updates to submodule hierarchy -I have been 
> looking at ways of automating such a roll out - this can be useful for 
> new project setups or for rolling out an update to all repos and 
> quickly integrating it into the submodule hierarchy.  The link below 
> shows something similar however it checks out a master branch of each 
> submodule in its hierarchy.
> https://chrisjean.com/recursively-updating-git-submodules/

How about

	git submodule update --init --recursive

? That should do the same as the script written in that blog post. Or am I missing something?

Cheers Heiko
-------------------------------------------------------------
Intel Ireland Limited (Branch)
Collinstown Industrial Park, Leixlip, County Kildare, Ireland
Registered Number: E902934

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

      reply	other threads:[~2015-06-02 14:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4C328B7D13677A4EAF715D0755A6D7EE25C56C89@irsmsx110.ger.corp.intel.com>
2015-05-22 13:46 ` Query on git submodules Frawley, Sarah
2015-05-26 17:01   ` Heiko Voigt
2015-05-27 13:20     ` FW: " Frawley, Sarah
2015-06-02  9:45       ` Mattias Vannergård
2015-06-02 11:17         ` Heiko Voigt
2015-06-02 11:27           ` Mattias Vannergård
2015-06-02 11:12       ` Heiko Voigt
2015-06-02 14:22         ` Frawley, Sarah [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=4C328B7D13677A4EAF715D0755A6D7EE25C60153@irsmsx110.ger.corp.intel.com \
    --to=sarah.frawley@intel.com \
    --cc=git@vger.kernel.org \
    --cc=hvoigt@hvoigt.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).