浏览代码

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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Thomas Petazzoni 5 年之前
父节点
当前提交
ffcd34af07
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      support/scripts/pkg-stats

+ 2 - 2
support/scripts/pkg-stats

@@ -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 ...")