From 6386d8ca2fe5907b589fe11b6dc5caeec0d667f7 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Thu, 28 Oct 2010 19:34:46 +0530 Subject: [PATCH] gl-reflog adc gains 'usage', loses some crappy warnings (actually these warnings can come in many other situations; I just noticed them when testing this adc) --- contrib/adc/gl-reflog | 21 ++++++++++++++------- src/gitolite.pm | 1 + 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/contrib/adc/gl-reflog b/contrib/adc/gl-reflog index c6f134b..b211317 100755 --- a/contrib/adc/gl-reflog +++ b/contrib/adc/gl-reflog @@ -13,13 +13,20 @@ use warnings; # - heavily dependent on the gitolite log file format (duh!) # - cannot recover if some other commits were made after the force push -# USAGE -# ssh git@server gl-reflog show r1 refs/heads/b1 -# # shows last 10 updates to branch b1 in repo r1 -# ssh git@server gl-reflog show r1 refs/heads/b1 20 -# # shows last 20 entries... -# ssh git@server gl-reflog recover r1 refs/heads/b1 -# # recovers the last update to b1 in r1 if it was a "+" +sub usage { + print STDERR <<'EOF'; + USAGE + ssh git@server gl-reflog show r1 refs/heads/b1 + # shows last 10 updates to branch b1 in repo r1 + ssh git@server gl-reflog show r1 refs/heads/b1 20 + # shows last 20 entries... + ssh git@server gl-reflog recover r1 refs/heads/b1 + # recovers the last update to b1 in r1 if it was a "+" +EOF + exit 1; +} + +usage unless (@ARGV >= 3); # NOTES # - the verb "recover" is used because this is expected to be used most often diff --git a/src/gitolite.pm b/src/gitolite.pm index 48bc679..f7a413f 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -320,6 +320,7 @@ sub new_repo # pull in basic group info unless ($cache_filled) { local(%repos, %groups); + local $^W = 0; # read group info from compiled config. At the time we're called # this info has not yet been pulled in by the rest of the code, so # we need to do this specially here. However, the info we're