gqt -- gitolite quick (re-)test

sometimes I want to quickly test a few lines of change within the context of
a currently-running/just-ran test, *without* doing the rollback etc.

Here's how you do that now:

  - in your source tree, make the change and then run:
        cp -a src hooks contrib/adc /some/tmp/place
  - go to the tester userid and re-run your tests like so:
        GQT=/some/tmp/place ./test-driver.sh
    it'll rollback as normal then overwrite src and hooks from $GQT

Also, there's now a "dbg" sub that can be used for quick printf-style
debugging.
This commit is contained in:
Sitaram Chamarty 2010-07-20 12:39:06 +05:30
parent 97126608b9
commit fbb9dafbd1
4 changed files with 17 additions and 1 deletions

View file

@ -57,6 +57,12 @@ sub wrap_open {
return $fh; return $fh;
} }
sub dbg {
for my $i (@_) {
print STDERR "DBG: $i\n";
}
}
sub log_it { sub log_it {
my ($ip, $logmsg); my ($ip, $logmsg);
open my $log_fh, ">>", $ENV{GL_LOG} or die "open log failed: $!\n"; open my $log_fh, ">>", $ENV{GL_LOG} or die "open log failed: $!\n";

View file

@ -8,4 +8,4 @@ tar xf rollback.tar
mkdir td mkdir td
scp -q $TESTDIR/rollback.server gitolite-test@localhost:rollback || { echo scp failed; exit 1; } scp -q $TESTDIR/rollback.server gitolite-test@localhost:rollback || { echo scp failed; exit 1; }
ssh gitolite-test@localhost ./rollback ssh gitolite-test@localhost ./rollback $GQT

View file

@ -3,3 +3,12 @@
cd cd
rm -rf .ssh .gitolite .gitolite.rc repositories gitolite-install rm -rf .ssh .gitolite .gitolite.rc repositories gitolite-install
tar xf rollback.tar tar xf rollback.tar
# if arg1 is a directory, we have to overwrite sources from there (see commit
# message for details)
if [ -d "$1" ]
then
cd .gitolite
/bin/cp -a $1/{src,hooks} .
cd
fi

View file

@ -54,6 +54,7 @@ ugc ()
git push ${1:-gitolite}:gitolite-admin master git push ${1:-gitolite}:gitolite-admin master
git fetch origin >/dev/null 2>&1 git fetch origin >/dev/null 2>&1
) >~/1 2>~/2 ) >~/1 2>~/2
grep DBG: ~/2 >/dev/null && grep . ~/1 ~/2
} }
mdc() mdc()