From: Johan Herland <johan@herland.net>
To: Lukasz Palczewski <l.palczewski@prevac.pl>
Cc: git@vger.kernel.org
Subject: Re: Restart submodule update --recursive
Date: Thu, 28 Oct 2010 12:35:14 +0200 [thread overview]
Message-ID: <201010281235.14313.johan@herland.net> (raw)
In-Reply-To: <loom.20101028T090353-376@post.gmane.org>
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@herland.net>
www.herland.net
next prev parent reply other threads:[~2010-10-28 10:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 7:25 Restart submodule update --recursive Lukasz Palczewski
2010-10-28 10:35 ` Johan Herland [this message]
2010-10-29 7:28 ` Lukasz Palczewski
2010-10-28 18:15 ` Jonathan Nieder
2010-10-29 7:17 ` Lukasz Palczewski
2010-10-29 9:12 ` Jonathan Nieder
2010-10-29 11:37 ` Lukasz Palczewski
2010-10-29 16:40 ` Jonathan Nieder
2010-10-30 7:17 ` Jens Lehmann
2010-11-02 8:18 ` Lukasz Palczewski
2010-11-02 11:08 ` Jens Lehmann
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201010281235.14313.johan@herland.net \
--to=johan@herland.net \
--cc=git@vger.kernel.org \
--cc=l.palczewski@prevac.pl \
/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.
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 NNTP newsgroup(s).