allow trace mode from remote client

just say (for example):

    git push git@server:reponame.git1

for trace level 1, and similarly for 2 and 3
This commit is contained in:
Sitaram Chamarty 2012-03-15 21:49:47 +05:30
parent 38cb9bfda9
commit db8dc8ca2d

View file

@ -77,9 +77,10 @@ sub parse_soc {
my $soc = $ENV{SSH_ORIGINAL_COMMAND};
$soc ||= 'info';
if ( $soc =~ m(^(git-(?:upload|receive)-pack) '/?(.*?)(?:\.git)?'$) ) {
if ( $soc =~ m(^(git-(?:upload|receive)-pack) '/?(.*?)(?:\.git(\d)?)?'$) ) {
# TODO git archive
my ( $verb, $repo ) = ( $1, $2 );
my ( $verb, $repo, $trace_level ) = ( $1, $2, $3 );
$ENV{D} = $trace_level if $trace_level;
_die "invalid repo name: '$repo'" if $repo !~ $REPONAME_PATT;
trace( 2, "git command", $soc );
return ( $verb, $repo );