From: Fredrik Gustafsson <iveqy@iveqy.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Fredrik Gustafsson <iveqy@iveqy.com>, git@vger.kernel.org
Subject: Re: GSOC proposal
Date: Fri, 25 Mar 2011 11:08:35 +0100 [thread overview]
Message-ID: <20110325100835.GB30376@paksenarrion.iveqy.com> (raw)
In-Reply-To: <4D8BD358.1030603@web.de>
[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]
On Fri, Mar 25, 2011 at 12:27:20AM +0100, Jens Lehmann wrote:
> > == Threat every module alike ==
> > When failing fetching a submodule, continue fetching the next one
> > instead of dying. There's no need to prevent fetching a submodule
> > beginning at 'z' just because a failing in fetching a submodule
> > beginning at 'a'. The submodules should not be alphabetically dependant
> > as they are now.
>
> I assume you are talking about the implicit fetch done by "git submodule
> update" here. The recursive submodule fetch that "git fetch" learned
> recently continues to fetch other submodules even if one or more fetches
> failed. But you are right that "git submodule update" should attempt to
> continue updating the remaining submodules too even if one of those
> updates failed along the way (This should be achieved with even less
> effort than the push issue mentioned above, so it would be an even
> easier starting point for people who want to get involved).
>
> /* snip */
>
> (And, as every year, it's a good idea for a prospective student to get
> involved in the git community before his application is accepted ...
> sending some patches is a good way to do that, maybe regarding one of
> the first two issues raised here? ;-)
I've attached a patch solving the submodule update-problem. A thing I
though about is if it's a good idéa to end the output with an error
summary. A git submodule update with 40-50 modules would easily let
an error go by undetected with this patch.
--
Med vänliga hälsningar
Fredrik Gustafsson
tel: 0733-608274
e-post: iveqy@iveqy.com
[-- Attachment #2: 0001-When-one-submodule-fails-continue-to-the-next.patch --]
[-- Type: text/x-diff, Size: 3542 bytes --]
>From 1bc9a5e69f7b3296bad6dd0449054de8501be5bd Mon Sep 17 00:00:00 2001
From: iveqy <iveqy@iveqy.com>
Date: Fri, 25 Mar 2011 10:43:42 +0100
Subject: [PATCH] When one submodule fails, continue to the next
---
git-submodule.sh | 60 ++++++++++++++++++++++++++++++++++++------------------
1 files changed, 40 insertions(+), 20 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3a13397..ae3abd1 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -342,8 +342,11 @@ cmd_init()
test -z "$url" || continue
url=$(git config -f .gitmodules submodule."$name".url)
- test -z "$url" &&
- die "No url found for submodule path '$path' in .gitmodules"
+ if test -z "$url"
+ then
+ say "No url found for submodule path '$path' in .gitmodules"
+ continue
+ fi
# Possibly a url relative to parent
case "$url" in
@@ -352,13 +355,17 @@ cmd_init()
;;
esac
- git config submodule."$name".url "$url" ||
- die "Failed to register url for submodule path '$path'"
+ if !(git config submodule."$name".url "$url")
+ then
+ say "Failed to register url for submodule path '$path'"
+ fi
upd="$(git config -f .gitmodules submodule."$name".update)"
- test -z "$upd" ||
- git config submodule."$name".update "$upd" ||
- die "Failed to register update mode for submodule path '$path'"
+ if !(test -z "$upd" || git config submodule."$name".update "$upd")
+ then
+ say "Failed to register update mode for submodule path '$path'"
+ continue
+ fi
say "Submodule '$name' ($url) registered for path '$path'"
done
@@ -446,9 +453,11 @@ cmd_update()
cloned_modules="$cloned_modules;$name"
subsha1=
else
- subsha1=$(clear_local_git_env; cd "$path" &&
- git rev-parse --verify HEAD) ||
- die "Unable to find current revision in submodule path '$path'"
+ if !(subsha1=$(clear_local_git_env; cd "$path" && git rev-parse --verify HEAD))
+ then
+ say "Unable to find current revision in submodule path '$path'"
+ continue
+ fi
fi
if ! test -z "$update"
@@ -466,9 +475,11 @@ cmd_update()
if test -z "$nofetch"
then
- (clear_local_git_env; cd "$path" &&
- git-fetch) ||
- die "Unable to fetch in submodule path '$path'"
+ if !(clear_local_git_env; cd "$path" && git-fetch)
+ then
+ say "Unable to fetch in submodule path '$path'"
+ continue
+ fi
fi
# Is this something we just cloned?
@@ -496,15 +507,21 @@ cmd_update()
;;
esac
- (clear_local_git_env; cd "$path" && $command "$sha1") ||
- die "Unable to $action '$sha1' in submodule path '$path'"
+ if !(clear_local_git_env; cd "$path" && $command "$sha1")
+ then
+ say "Unable to $action '$sha1' in submodule path '$path'"
+ continue;
+ fi
say "Submodule path '$path': $msg '$sha1'"
fi
if test -n "$recursive"
then
- (clear_local_git_env; cd "$path" && eval cmd_update "$orig_flags") ||
- die "Failed to recurse into submodule path '$path'"
+ if !(clear_local_git_env; cd "$path" && eval cmd_update "$orig_flags")
+ then
+ say "Failed to recurse into submodule path '$path'"
+ continue;
+ fi
fi
done
}
@@ -790,13 +807,16 @@ cmd_status()
if test -n "$recursive"
then
- (
+ if ! (
prefix="$displaypath/"
clear_local_git_env
cd "$path" &&
eval cmd_status "$orig_args"
- ) ||
- die "Failed to recurse into submodule path '$path'"
+ )
+ then
+ say "Failed to recurse into submodule path '$path'"
+ continue
+ fi
fi
done
}
--
1.7.4.1.433.gcd306.dirty
next prev parent reply other threads:[~2011-03-25 9:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 22:01 GSOC proposal Fredrik Gustafsson
2011-03-24 23:27 ` Jens Lehmann
2011-03-24 23:47 ` Junio C Hamano
2011-03-25 10:06 ` Fredrik Gustafsson
2011-03-25 23:07 ` Jens Lehmann
2011-03-25 10:08 ` Fredrik Gustafsson [this message]
[not found] <CAH-tXsAY0GErMAwi_TMaq0S4GuGx-OcPtEkJnXNqfGEyQq44_A@mail.gmail.com>
2012-03-27 12:47 ` GSOC Proposal Jakub Narebski
-- strict thread matches above, loose matches on Subject: below --
2016-03-24 20:15 GSoC proposal work
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=20110325100835.GB30376@paksenarrion.iveqy.com \
--to=iveqy@iveqy.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
/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).