From 520eff618908224c0ca39ef9d22720cdcc446102 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 7 Feb 2012 06:26:57 +0530 Subject: [PATCH] added ADC overrides for setdesc and getdesc John from kernel.org wanted this; for details see [1] [1]: http://groups.google.com/group/gitolite/browse_thread/thread/daf92ef85d121234 --- contrib/adc/getdesc | 23 +++++++++++++++++++++++ contrib/adc/setdesc | 25 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 contrib/adc/getdesc create mode 100644 contrib/adc/setdesc diff --git a/contrib/adc/getdesc b/contrib/adc/getdesc new file mode 100644 index 0000000..d438ee6 --- /dev/null +++ b/contrib/adc/getdesc @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +die "ENV GL_RC not set\n" unless $ENV{GL_RC}; +die "ENV GL_BINDIR not set\n" unless $ENV{GL_BINDIR}; + +unshift @INC, $ENV{GL_BINDIR}; +require gitolite or die "parse gitolite.pm failed\n"; +gitolite->import; + +my $repo = shift; +die "need a reponame\n" unless $repo; + +my $ret = check_access($repo, 'refs/heads/master', '+', 1); + +die "sorry you don't have rights to do this\n" if $ret =~ /DENIED/; + +wrap_chdir($ENV{GL_REPO_BASE_ABS}); +wrap_chdir("$repo.git"); + +print slurp("description") if -f "description"; diff --git a/contrib/adc/setdesc b/contrib/adc/setdesc new file mode 100644 index 0000000..099bb0b --- /dev/null +++ b/contrib/adc/setdesc @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +die "ENV GL_RC not set\n" unless $ENV{GL_RC}; +die "ENV GL_BINDIR not set\n" unless $ENV{GL_BINDIR}; + +unshift @INC, $ENV{GL_BINDIR}; +require gitolite or die "parse gitolite.pm failed\n"; +gitolite->import; + +my $repo = shift; +die "need a reponame\n" unless $repo; + +my $ret = check_access($repo, 'refs/heads/master', '+', 1); + +die "sorry you don't have rights to do this\n" if $ret =~ /DENIED/; + +wrap_chdir($ENV{GL_REPO_BASE_ABS}); +wrap_chdir("$repo.git"); + +wrap_print("description", <>); +print "New description is:\n"; +print slurp("description");