Merge branch 'ab/perf-installed-fix'
authorJunio C Hamano <gitster@pobox.com>
Sun, 19 May 2019 07:45:28 +0000 (16:45 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 19 May 2019 07:45:28 +0000 (16:45 +0900)
Performance test framework has been broken and measured the version
of Git that happens to be on $PATH, not the specified one to
measure, for a while, which has been corrected.

* ab/perf-installed-fix:
perf-lib.sh: forbid the use of GIT_TEST_INSTALLED
perf tests: add "bindir" prefix to git tree test results
perf-lib.sh: remove GIT_TEST_INSTALLED from perf-lib.sh
perf-lib.sh: make "./run <revisions>" use the correct gits
perf aggregate: remove GIT_TEST_INSTALLED from --codespeed
perf README: correct docs for 3c8f12c96c regression

1  2 
t/perf/aggregate.perl
diff --combined t/perf/aggregate.perl
index 76dd48f8908e4f001152088845423d1e0f631727,b951747e080012340f6469d26b333a239fbde1a5..66554d216122d26699e425b35166de460fa3821f
@@@ -3,8 -3,10 +3,9 @@@
  use lib '../../perl/build/lib';
  use strict;
  use warnings;
 -use JSON;
  use Getopt::Long;
  use Git;
+ use Cwd qw(realpath);
  
  sub get_times {
        my $name = shift;
@@@ -98,18 -100,21 +99,21 @@@ usage() unless $rc
  while (scalar @ARGV) {
        my $arg = $ARGV[0];
        my $dir;
+       my $prefix = '';
        last if -f $arg or $arg eq "--";
        if (! -d $arg) {
                my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
                $dir = "build/".$rev;
+       } elsif ($arg eq '.') {
+               $dir = '.';
        } else {
-               $arg =~ s{/*$}{};
-               $dir = $arg;
-               $dirabbrevs{$dir} = $dir;
+               $dir = realpath($arg);
+               $dirnames{$dir} = $dir;
+               $prefix .= 'bindir';
        }
        push @dirs, $dir;
-       $dirnames{$dir} = $arg;
-       my $prefix = $dir;
+       $dirnames{$dir} ||= $arg;
+       $prefix .= $dir;
        $prefix =~ tr/^a-zA-Z0-9/_/c;
        $prefixes{$dir} = $prefix . '.';
        shift @ARGV;
@@@ -311,9 -316,6 +315,6 @@@ sub print_codespeed_results 
                $environment = $reponame;
        } elsif (exists $ENV{GIT_PERF_REPO_NAME} and $ENV{GIT_PERF_REPO_NAME} ne "") {
                $environment = $ENV{GIT_PERF_REPO_NAME};
-       } elsif (exists $ENV{GIT_TEST_INSTALLED} and $ENV{GIT_TEST_INSTALLED} ne "") {
-               $environment = $ENV{GIT_TEST_INSTALLED};
-               $environment =~ s|/bin-wrappers$||;
        } else {
                $environment = `uname -r`;
                chomp $environment;
                }
        }
  
 -      print to_json(\@data, {utf8 => 1, pretty => 1, canonical => 1}), "\n";
 +      require JSON;
 +      print JSON::to_json(\@data, {utf8 => 1, pretty => 1, canonical => 1}), "\n";
  }
  
  binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";