scripts/patchreview: Add commit to stored json data
PATCH 1/2 scripts/patchreview: Add commit to stored json data
Save commit data when writing to the json file so the results can be copared/extended later.
Signed-off-by Richard Purdie <[email protected]>
--- scripts/contrib/patchreview.py | 1 + 1 file changed, 1 insertion(+)
scripts/contrib/patchreview.py +1 -0
@@ -222,6 +222,7 @@ if __name__ == "__main__": row = collections.Counter() row["total"] = len(results) row["date"] = subprocess.check_output(["git", "-C", args.directory, "show", "-s", "--pretty=format:%cd", "--date=format:%s"]).decode("utf-8").strip() + row["commit"] = subprocess.check_output(["git", "-C", args.directory, "show", "-s", "--pretty=format:%H"]).decode("utf-8").strip() for r in results.values(): if r.upstream_status in status_values: row[r.upstream_status] += 1
Signature · 1 line
2.34.1
PATCH 2/2 scripts/patchreview: Make json output human parsable
Sort dict keys in the json output and use tab spacing. This means when commited into git, the diffs are human readable but it is more compact filesize than space indentation.
Signed-off-by Richard Purdie <[email protected]>
--- scripts/contrib/patchreview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/contrib/patchreview.py +1 -1
@@ -232,7 +232,7 @@ if __name__ == "__main__": row['malformed-sob'] += 1 data.append(row) - json.dump(data, open(args.json, "w")) + json.dump(data, open(args.json, "w"), sort_keys=True, indent="\t") if args.histogram: print()
Signature · 1 line
2.34.1