From d135bd3f983fce11468037792b696cc32316023a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:27:50 -0500 Subject: add gitremotes script, parsing list of remotes on doc/git.mdwn Any remotes added will automatically be pulled into my working copy. --- gitremotes | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 gitremotes (limited to 'gitremotes') diff --git a/gitremotes b/gitremotes new file mode 100755 index 000000000..b14490924 --- /dev/null +++ b/gitremotes @@ -0,0 +1,29 @@ +#!/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; + +open (IN, "doc/git.mdwn") || die "doc/git.mdwn: $!"; +while () { + if (/^\*\s+\[\[(\w+)\]\]\s+<([^>]+)>/) { + # note that the remote name has to be a simple word (\w) + # for security/sanity reasons + my $remote=$1; + my $url=$2; + + # check configured url to deal with it changing + my $info=`git remote show -n $remote`; + my ($oldurl)=$info=~/URL: (.*)/m; + if ($oldurl ne $url) { + system("git remote rm $remote 2>/dev/null"); + $error |= system("git", "remote", "add", "-f", $remote, $url); + } + else { + $error |= system("git", "fetch", $remote); + } + } +} +close IN; + +exit $error; -- cgit v1.2.3 From 3305fb9d36de3c32552da036ebc6db2611fe13fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:31:25 -0500 Subject: markdown fixes --- doc/git.mdwn | 10 +++++----- gitremotes | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gitremotes') diff --git a/doc/git.mdwn b/doc/git.mdwn index 511a0a75c..abb25722a 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -30,13 +30,13 @@ into [[Joey]]'s working tree. This is recommended. :-) -* [[github]] +* github `git://github.com/joeyh/ikiwiki.git` [browse](http://github.com/joeyh/ikiwiki/tree/master) A mirror of the main repo, automatically updated. -* [[smcv]] -* [[intrigeri]] -* [[gmcmanus]] -* [[jelmer]] +* [[smcv]] `git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git` +* [[intrigeri]] `git://gaffer.ptitcanardnoir.org/ikiwiki.git` +* [[gmcmanus]] `git://github.com/gmcmanus/ikiwiki.git` +* [[jelmer]] `git://git.samba.org/jelmer/ikiwiki.git` ## branches diff --git a/gitremotes b/gitremotes index b14490924..7b9484dd1 100755 --- a/gitremotes +++ b/gitremotes @@ -6,7 +6,7 @@ my $error=0; open (IN, "doc/git.mdwn") || die "doc/git.mdwn: $!"; while () { - if (/^\*\s+\[\[(\w+)\]\]\s+<([^>]+)>/) { + if (/^\*\s+\[?\[?(\w+)\]?\]?\s+`([^>]+)`/) { # note that the remote name has to be a simple word (\w) # for security/sanity reasons my $remote=$1; -- cgit v1.2.3