From 2bbe1bf9af4ba20f28a17d5e16a467313d2e37bd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Jul 2008 18:29:33 -0400 Subject: [PATCH] move more settings out to rcs --- IkiWiki.pm | 33 --------------------------------- IkiWiki/Rcs/git.pm | 9 +++++++++ 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 76f1292fc..5724518da 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -94,25 +94,6 @@ sub getsetup () { #{{{ safe => 0, # don't allow overriding rebuild => 0, }, - historyurl => { - type => "string", - # TODO should be set per-rcs to allow different - # examples and descriptions - default => '', - example => "XXX", - description => "XXX", - safe => 1, - rebuild => 1, - }, - diffurl => { - type => "string", - # TODO ditto above - default => '', - example => "XXX", - description => "XXX", - safe => 1, - rebuild => 1, - }, discussion => { type => "boolean", default => 1, @@ -120,20 +101,6 @@ sub getsetup () { #{{{ safe => 1, rebuild => 1, }, - gitorigin_branch => { - type => "string", - default => "origin", - description => "the git origin to pull from", - safe => 0, # paranoia - rebuild => 0, - }, - gitmaster_branch => { - type => "string", - default => "master", - description => "the git master branch", - safe => 0, # paranoia - rebuild => 0, - }, wrappers => { type => "string", default => undef, diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index 7c3ae9276..bcf317002 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -11,6 +11,15 @@ use open qw{:utf8 :std}; my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes +hook(type => "checkconfig", id => "git", call => sub { #{{{ + if (! defined $config{gitorigin_branch}) { + $config{gitorigin_branch}="origin"; + } + if (! defined $config{gitmaster_branch}) { + $config{gitmaster_branch}="master"; + } +}); #}}} + hook(type => "getsetup", id => "git", call => sub { #{{{ return historyurl => { -- 2.44.0