Using submodules for third_party/

Jelmer Vernooij jelmer at samba.org
Mon Jan 12 16:13:48 MST 2015


On Mon, Dec 08, 2014 at 10:01:31AM +0100, Stefan (metze) Metzmacher wrote:
> >   This also only affects new checkouts and fetches of changes to the
> >   submodules. If the submodule reference doesn't change, there is no
> >   need for updates.
> 
> My typical setup is the following:
> 
> I have a bare repository on my laptop where I configured a lot of
> remotes, a cronjob runs 'git remote update' every few minutes.
> 
> Then I have working repositories/checkouts, which are configured like this:
> 
> metze at SERNOX14:~/devel/samba/3.X/masterF$ cat .git/objects/info/alternates
> /home/metze/devel/samba/samba-bare.git/objects
> metze at SERNOX14:~/devel/samba/3.X/masterF$ ls -la .git/refs/
> insgesamt 64
> drwxrws--- 6 metze metze  4096 Nov 16  2013 .
> drwxrws--- 9 metze metze  4096 Dez  4 10:21 ..
> drwxrws--- 2 metze metze  4096 Apr 21  2009 bisect
> drwxrws--- 2 metze metze  4096 Dez  4 10:21 heads
> lrwxrwxrwx 1 metze metze    51 Jun  7  2011 remotes ->
> /home/metze/devel/samba/samba-bare.git/refs/remotes
> -rw-rw---- 1 metze metze    41 Nov 16  2013 stash
> drwxrws--- 2 metze metze  4096 Apr 29  2010 stash.d
> drwxrws--- 4 metze metze 40960 Jun 23 14:09 tags
> 
> If I remember correctly this wasn't supported when using git submodules,
> when we discussed this topic the last time. So I nacked the proposal.
> 
> However I'm open to reevaluate, but everything needs to be available
> offline after doing a 'git clone git://git.samba.org/samba.git' with
> 'fetch.recurseSubmodules = yes' configured in ~/.gitconfig. And it needs
> to support my workflow...
> 
> I just tested this with your repository which has submodules
> in the following branch:
> https://git.samba.org/?p=jelmer/samba.git;a=shortlog;h=refs/heads/for-review/submodules
> 
> metze at SERNOX14:/dev/shm$ git config fetch.recurseSubmodules
> yes
> metze at SERNOX14:/dev/shm$ git clone git://git.samba.org/jelmer/samba.git
> Klone nach 'samba'...
> remote: Counting objects: 986939, done.
> remote: Compressing objects: 100% (230556/230556), done.
> remote: Total 986939 (delta 752585), reused 979504 (delta 745183)
> Empfange Objekte: 100% (986939/986939), 228.08 MiB | 1.78 MiB/s, done.
> Löse Unterschiede auf: 100% (752585/752585), done.
> Prüfe Konnektivität... Fertig.
> metze at SERNOX14:/dev/shm$ cd samba/
> git show 5a0c331b259407896e63267e578efafee879ed4f | grep 'Subproject commit'
> +Subproject commit 43c14fd73b3b94211ff8bfad8f894b48cce4e577
> metze at SERNOX14:/dev/shm/samba$ git show
> 43c14fd73b3b94211ff8bfad8f894b48cce4e577
> fatal: bad object 43c14fd73b3b94211ff8bfad8f894b48cce4e577
You need to look for the dnspython head object in the dnspython repository. E.g.:

% GIT_DIR=.git/modules/third_party/dnspython git show 43c14fd73b3b94211ff8bfad8f894b48cce4e577

or alternatively:

% echo ../modules/third_party/dnspython/objects >> .git/objects/info/alternates
% git show 43c14fd73b3b94211ff8bfad8f894b48cce4e577

does that meet your requirements?

Cheers,

Jelmer


More information about the samba-technical mailing list