From: Joey Hess Date: Thu, 11 Dec 2008 18:27:50 +0000 (-0500) Subject: add gitremotes script, parsing list of remotes on doc/git.mdwn X-Git-Tag: 2.71~165 X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=commitdiff_plain;h=d135bd3f983fce11468037792b696cc32316023a add gitremotes script, parsing list of remotes on doc/git.mdwn Any remotes added will automatically be pulled into my working copy. --- diff --git a/doc/git.mdwn b/doc/git.mdwn index e7f47f5a0..00c108616 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -16,17 +16,29 @@ Or like this if your firewall only passes http traffic (slow): The gitweb is [here](http://git.ikiwiki.info/?p=ikiwiki). -There is also a mirror [on github](http://github.com/joeyh/ikiwiki/tree/master). - Commits to this git repository are fed into [CIA](http://cia.vc), and can be browsed, subscribed to etc on its [project page](http://cia.vc/stats/project/ikiwiki). They're also fed into [twitter](http://twitter.com/ikiwiki). -## branches +## personal git repositories You are of course free to set up your own ikiwiki git repository with your -own [[patches|patch]]. +own [[patches|patch]]. If you list it here, the `gitremotes` script will +automatically add it to git remotes. Your repo will automatically be pulled +into [[Joey]]'s working tree. This is recommended. :-) + +# Machine-parsed format: * wikilink + +* [[github]] + [browse](http://github.com/joeyh/ikiwiki/tree/master) + A mirror of the main repo, automatically updated. +* [[smcv]] +* [[intrigeri]] +* [[gmcmanus]] +* [[jelmer]] + +## branches Some of the branches included in the main repository include: @@ -38,9 +50,9 @@ Some of the branches included in the main repository include: * `wikiwyg` adds [[todo/wikiwyg]] support. It is unmerged pending some changes. * `darcs` is being used to add darcs support. -* `pristine-tar` contains deltas that - [pristine-tar](http://kitenet.net/~joey/code/pristine-tar) - can use to recreate released tarballs of ikiwiki * `debian-stable` is used for updates to the old version included in Debian's stable release, and `debian-testing` is used for updates to Debian's testing release. +* `pristine-tar` contains deltas that + [pristine-tar](http://kitenet.net/~joey/code/pristine-tar) + can use to recreate released tarballs of ikiwiki 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;