diff --git a/src/Gitolite/Rc.pm b/src/Gitolite/Rc.pm index 49ca35d..6a7dd32 100644 --- a/src/Gitolite/Rc.pm +++ b/src/Gitolite/Rc.pm @@ -216,6 +216,7 @@ __DATA__ SYNTACTIC_SUGAR => [ # 'continuation-lines', + 'legacy-delegation-abort', ], # comment out or uncomment as needed diff --git a/src/syntactic-sugar/keysubdirs-as-groups b/src/syntactic-sugar/keysubdirs-as-groups index 75c015d..69a69b1 100755 --- a/src/syntactic-sugar/keysubdirs-as-groups +++ b/src/syntactic-sugar/keysubdirs-as-groups @@ -7,7 +7,7 @@ # taken as the group name. sub sugar_script { - trace( 2, "running 'keysubdirs-as-groups' sugar script..." ); + Gitolite::Common::trace( 2, "running 'keysubdirs-as-groups' sugar script..." ); my $lines = shift; my @out = @{$lines}; diff --git a/src/syntactic-sugar/legacy-delegation-abort b/src/syntactic-sugar/legacy-delegation-abort new file mode 100755 index 0000000..1625632 --- /dev/null +++ b/src/syntactic-sugar/legacy-delegation-abort @@ -0,0 +1,26 @@ +# vim: syn=perl: + +# "sugar script" (syntactic sugar helper) for gitolite3 + +# Aborts if you appear to be using legacy delegation. + +# Note: you cannot fix this using sugar; subconf processing has already +# happened by the time it gets to this point. + +# TODO: supply doc keyword, and that doc should tell people to add this to the +# end of the main conf file: + +# repo gitolite-admin +# - NAME/ = @all +# subconf "fragments/*.conf" + +sub sugar_script { + Gitolite::Common::trace( 2, "running 'legacy-delegation-warn' sugar script..." ); + my $lines = shift; + + my $text = join("\n", @$lines); + if ($text =~ m(NAME/conf/fragments/) and $text !~ /^subconf /m) { + die "\t**** ABORT ****\nYou may be using legacy delegation; see docs\n"; + } + return $lines; +}