support/scripts/pkg-stats: simplify Git commit id retrieval
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 12 Sep 2019 16:55:22 +0000 (18:55 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 15 Sep 2019 14:10:22 +0000 (16:10 +0200)
As suggested by Baruch Siach, using "git rev-parse HEAD" is a lot
simpler than playing around with "git log" to just retrieve the commit
id corresponding to the current HEAD.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/scripts/pkg-stats

index 6cb3a6a0386ec5cb04b5530543ca32dcbe09b91f..e477828f7b6e8e61303093c71c3eede5165a1ded 100755 (executable)
@@ -727,8 +727,8 @@ def __main__():
     else:
         package_list = None
     date = datetime.datetime.utcnow()
-    commit = subprocess.check_output(['git', 'log', 'HEAD', '-n', '1',
-                                      '--pretty=format:%H']).splitlines()[0]
+    commit = subprocess.check_output(['git', 'rev-parse',
+                                      'HEAD']).splitlines()[0]
     print("Build package list ...")
     packages = get_pkglist(args.npackages, package_list)
     print("Getting package make info ...")