[Reproducible-commits] [misc] 01/01: reports: more automation, for bin/review-stats

Ximin Luo infinity0 at debian.org
Mon May 16 16:57:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository misc.

commit 6dcb4f5280c9193df805a67d11e3f6cfa02e1961
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon May 16 18:57:34 2016 +0200

    reports: more automation, for bin/review-stats
    
    - also fix the previous git snippet; `git show $branch@{$date}` is NOT reliable
      and it does not work on a fresh clone; a better form generally is
    
      $ git show $(git rev-list -n1 --until $date $branch)
---
 reports/README           |  4 +---
 reports/bin/review-stats | 12 ++++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/reports/README b/reports/README
index 8e87bd8..afff0f9 100644
--- a/reports/README
+++ b/reports/README
@@ -60,9 +60,7 @@ Process
    Make sure you get a recent copy of `notes.git`. Then:
 
        $ . ../misc/reports/latest/variables
-       $ ../misc/reports/bin/review-stats \
-              <(git show "master@{@$RB_REPORT_WEEK_START}":packages.yml) \
-              <(git show "master@{@$RB_REPORT_WEEK_END}":packages.yml)
+       $ ../misc/reports/bin/review-stats
 
    The UDD query to know who reported how many FTBFS follows:
 
diff --git a/reports/bin/review-stats b/reports/bin/review-stats
index 1c34d10..3bcf057 100755
--- a/reports/bin/review-stats
+++ b/reports/bin/review-stats
@@ -1,12 +1,24 @@
 #!/usr/bin/env python3
 # review-stats: compute stats about reviews between two packages.yml files
+# must be run from the notes.git repository, and not this one
 #
 # Copyright © 2015 Lunar <lunar at debian.org>
 # Licensed under WTFPL — http://www.wtfpl.net/txt/copying/
 
+import os
+import subprocess
 import sys
 import yaml
 
+if len(sys.argv) == 1:
+    # get packages.yml from git if $1 $2 not set
+    if "RB_REPORT_WEEK_START" not in os.environ or "RB_REPORT_WEEK_END" not in os.environ:
+        raise ValueError("RB_REPORT_WEEK_{START,END} not set")
+    sys.exit(subprocess.check_call(["bash", "-c", """%s \
+        <(git show $(git rev-list -n1 --until @$RB_REPORT_WEEK_START master):packages.yml) \
+        <(git show $(git rev-list -n1 --until @$RB_REPORT_WEEK_END master):packages.yml)
+    """ % sys.argv[0]]))
+
 old = yaml.safe_load(open(sys.argv[1]))
 new = yaml.safe_load(open(sys.argv[2]))
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list