All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] scripts/patchreview: Add commit to stored json data
@ 2022-05-23 12:44 Richard Purdie
  2022-05-23 12:44 ` [PATCH 2/2] scripts/patchreview: Make json output human parsable Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2022-05-23 12:44 UTC (permalink / raw)
  To: openembedded-core

Save commit data when writing to the json file so the results can
be copared/extended later.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/contrib/patchreview.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/contrib/patchreview.py b/scripts/contrib/patchreview.py
index dc417b4c55b4..002991c559cf 100755
--- a/scripts/contrib/patchreview.py
+++ b/scripts/contrib/patchreview.py
@@ -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
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] scripts/patchreview: Make json output human parsable
  2022-05-23 12:44 [PATCH 1/2] scripts/patchreview: Add commit to stored json data Richard Purdie
@ 2022-05-23 12:44 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2022-05-23 12:44 UTC (permalink / raw)
  To: openembedded-core

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 <richard.purdie@linuxfoundation.org>
---
 scripts/contrib/patchreview.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/contrib/patchreview.py b/scripts/contrib/patchreview.py
index 002991c559cf..85d2169ad131 100755
--- a/scripts/contrib/patchreview.py
+++ b/scripts/contrib/patchreview.py
@@ -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()
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-23 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 12:44 [PATCH 1/2] scripts/patchreview: Add commit to stored json data Richard Purdie
2022-05-23 12:44 ` [PATCH 2/2] scripts/patchreview: Make json output human parsable Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.