Skip to contentSkip to conversation

support/scripts/pkg-stats: simplify Git commit id retrieval

PATCH New Thomas Petazzoni 1 participant 2 messages Sep 12, 2019 – Sep 15, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/scripts/pkg-stats: simplify Git commit id retrieval

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.

---
 support/scripts/pkg-stats | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
support/scripts/pkg-stats +2 -2
index 6cb3a6a038..e477828f7b 100755
@@ -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 ...")
Signature · 1 line
2.21.0
author Applied
#1 lore raw

PATCH 1/1 support/scripts/pkg-stats: simplify Git commit id retrieval

Quoted 8 lines · On Thu, 12 Sep 2019 18:55:22 +0200 Thomas Petazzoni…

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.

---
 support/scripts/pkg-stats | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com