Re: Restart submodule update --recursive

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

 



On Thursday 28 October 2010, Lukasz Palczewski wrote:
> Hi.
> I have a problem with the time and the stoping of the submodule
> update command when the error occures.
> In our project we have lots of submodules with submodules in them. So
> I use git command: git submodule update --recursive, to update all
> the submodules, but it take some time to do it. I have to do it quite
> often becouse I'm a tester of the software and I usually don't know
> which submodule I need to update, to have the newest version. If I
> have some local changes in some submodule, the command stops and I
> have to revert the changes and start the submodule update from the
> begining again.
> Is there a way to start the submodule update from the place, where
> the error occured and the command stop? Something like:
> git submodule update --recursive --restart_form_last_error

No, but you can use 'git submodule foreach --recursive "$SCRIPT"', where 
$SCRIPT is a command (or list of commands) for updating your current 
submodule. As long as the SCRIPT returns successfully (exit value 0), 
the submodule foreach will keep going into each submodule. You can the 
look at the output from your script to deduce which submodules need to 
be updated manually. Or you may even be able to solve your problem 
automatically.

You could for example try something like (all on one line):

git submodule foreach --recursive "git fetch && git stash && git 
checkout $sha1 && git stash pop; true"


...Johan

-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
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]