summaryrefslogtreecommitdiff
path: root/t/perf/aggregate.perl
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2018-02-01 10:14:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-02 19:47:41 (GMT)
commitfb2c362eb5dd998b74a30fe55df3f44a26ea6fd6 (patch)
tree04a79961b0da838d57649e006a4c469c75547571 /t/perf/aggregate.perl
parentcd5d4bf609339dec94ee64fce4bac4468e5277fc (diff)
downloadgit-fb2c362eb5dd998b74a30fe55df3f44a26ea6fd6.zip
git-fb2c362eb5dd998b74a30fe55df3f44a26ea6fd6.tar.gz
git-fb2c362eb5dd998b74a30fe55df3f44a26ea6fd6.tar.bz2
perf/aggregate: add --reponame option
This makes it easier to use the aggregate script on the command line when one wants to get the "environment" fields set in the codespeed output. Previously setting GIT_REPO_NAME was needed for this purpose. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/aggregate.perl')
-rwxr-xr-xt/perf/aggregate.perl15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/perf/aggregate.perl b/t/perf/aggregate.perl
index bbf0f30..a609292 100755
--- a/t/perf/aggregate.perl
+++ b/t/perf/aggregate.perl
@@ -37,7 +37,7 @@ sub format_times {
}
my (@dirs, %dirnames, %dirabbrevs, %prefixes, @tests,
- $codespeed, $subsection);
+ $codespeed, $subsection, $reponame);
while (scalar @ARGV) {
my $arg = $ARGV[0];
my $dir;
@@ -55,6 +55,15 @@ while (scalar @ARGV) {
}
next;
}
+ if ($arg eq "--reponame") {
+ shift @ARGV;
+ $reponame = $ARGV[0];
+ shift @ARGV;
+ if (! $reponame) {
+ die "empty reponame";
+ }
+ next;
+ }
last if -f $arg or $arg eq "--";
if (! -d $arg) {
my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
@@ -210,7 +219,9 @@ sub print_codespeed_results {
}
my $environment;
- if (exists $ENV{GIT_PERF_REPO_NAME} and $ENV{GIT_PERF_REPO_NAME} ne "") {
+ if ($reponame) {
+ $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};