2 # Parses list of remotes in doc/git.mdwn, configures git to use them
3 # all. After running this, use "git remote update --prune" to pull
4 # updates from all remotes.
6 open (IN, "doc/git.mdwn") || die "doc/git.mdwn: $!";
8 if (/^\*\s+\[?\[?(\w+)(?:\|\w+)?\]?\]?\s+`([^>]+)`/) {
9 # note that the remote name has to be a simple word (\w)
10 # for security/sanity reasons
14 # check configured url to deal with it changing
15 my $info=`git remote show -n $remote`;
16 my ($oldurl)=$info=~/URL: (.*)/m;
17 if ($oldurl ne $url) {
18 system("git remote rm $remote 2>/dev/null");
19 system("git", "remote", "add", "-f", $remote, $url);
20 system("git", "config", "remote.$remote.tagopt",