From d4b4b3d988c0b7bfc74876c3b55b787baffc0dcf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 20:16:57 -0400 Subject: avoid fetching tags from random remotes git makes it too easy to get crap tags into origin --- gitremotes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes index 91bf2fe84..bcee005c3 100755 --- a/gitremotes +++ b/gitremotes @@ -20,7 +20,7 @@ while () { $error |= system("git", "remote", "add", "-f", $remote, $url); } else { - $error |= system("git", "fetch", $remote); + $error |= system("git", "fetch", "--no-tag", $remote); } } } -- cgit v1.2.3 From 588b8951d37a4ef737edf3e36e0e8ae6c9a51f38 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 21:51:06 -0400 Subject: print which remotes are failing --- gitremotes | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes index bcee005c3..e2468814b 100755 --- a/gitremotes +++ b/gitremotes @@ -15,13 +15,19 @@ while () { # check configured url to deal with it changing my $info=`git remote show -n $remote`; my ($oldurl)=$info=~/URL: (.*)/m; + my $r; if ($oldurl ne $url) { system("git remote rm $remote 2>/dev/null"); - $error |= system("git", "remote", "add", "-f", $remote, $url); + $r = system("git", "remote", "add", "-f", $remote, $url) } else { - $error |= system("git", "fetch", "--no-tag", $remote); + $r = system("git", "fetch", "--no-tag", $remote); } + + if ($r != 0) { + print "$remote failed\n"; + } + $error |= $r; } } close IN; -- cgit v1.2.3 From 0294fdfb5c50e5af22acc14407a2b69c79360e44 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Dec 2009 14:38:10 -0500 Subject: call git remote prune to drop stale tracking branches --- gitremotes | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes index e2468814b..d49cf2d9e 100755 --- a/gitremotes +++ b/gitremotes @@ -28,6 +28,9 @@ while () { print "$remote failed\n"; } $error |= $r; + + # drop stale tracking branches + system("git", "remote", "prune", $remote); } } close IN; -- cgit v1.2.3 From 958e83230d36bbf995329981a659ee69717a0451 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Dec 2009 14:44:50 -0500 Subject: drop remote pulling; can be done using git remote update --prune --- gitremotes | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes index d49cf2d9e..f596c650f 100755 --- a/gitremotes +++ b/gitremotes @@ -1,8 +1,7 @@ #!/usr/bin/perl # Parses list of remotes in doc/git.mdwn, configures git to use them -# all, and fetches updates from them. - -my $error=0; +# all. After running this, use "git remote update --prune" to pull +# updates from all remotes. open (IN, "doc/git.mdwn") || die "doc/git.mdwn: $!"; while () { @@ -15,24 +14,10 @@ while () { # check configured url to deal with it changing my $info=`git remote show -n $remote`; my ($oldurl)=$info=~/URL: (.*)/m; - my $r; if ($oldurl ne $url) { system("git remote rm $remote 2>/dev/null"); - $r = system("git", "remote", "add", "-f", $remote, $url) - } - else { - $r = system("git", "fetch", "--no-tag", $remote); + system("git", "remote", "add", "-f", $remote, $url) } - - if ($r != 0) { - print "$remote failed\n"; - } - $error |= $r; - - # drop stale tracking branches - system("git", "remote", "prune", $remote); } } close IN; - -exit $error; -- cgit v1.2.3 From c2c57f0cfba182964359f0ee71f84fb1b935d10f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 7 May 2010 17:46:21 +0100 Subject: gitremotes: don't fetch tags, other than from ikiwiki.info Getting this change in an existing git clone requires removing or reconfiguring the remotes. --- gitremotes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes index f596c650f..6c03011a8 100755 --- a/gitremotes +++ b/gitremotes @@ -16,7 +16,9 @@ while () { my ($oldurl)=$info=~/URL: (.*)/m; if ($oldurl ne $url) { system("git remote rm $remote 2>/dev/null"); - system("git", "remote", "add", "-f", $remote, $url) + system("git", "remote", "add", "-f", $remote, $url); + system("git", "config", "remote.$remote.tagopt", + "--no-tags"); } } } -- cgit v1.2.3 From 2d60e55303fbabe70b42ee31703a8d4aca2d8460 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 9 May 2010 16:44:47 +0100 Subject: gitremotes: don't fetch the new remote until we've turned off tags --- gitremotes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes index 6c03011a8..5cafad1b8 100755 --- a/gitremotes +++ b/gitremotes @@ -16,9 +16,10 @@ while () { my ($oldurl)=$info=~/URL: (.*)/m; if ($oldurl ne $url) { system("git remote rm $remote 2>/dev/null"); - system("git", "remote", "add", "-f", $remote, $url); + system("git", "remote", "add", $remote, $url); system("git", "config", "remote.$remote.tagopt", "--no-tags"); + system("git", "fetch", $remote); } } } -- cgit v1.2.3