From patchwork Thu Sep 12 16:55:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1161684 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46TlJX2RsTz9sCJ for ; Fri, 13 Sep 2019 02:55:39 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B8B7B850E1; Thu, 12 Sep 2019 16:55:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V7mtd2oCIxNY; Thu, 12 Sep 2019 16:55:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 475F385FD0; Thu, 12 Sep 2019 16:55:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id C587B1BF2A7 for ; Thu, 12 Sep 2019 16:55:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C22D1203E8 for ; Thu, 12 Sep 2019 16:55:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8tUzS1JLeEld for ; Thu, 12 Sep 2019 16:55:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by silver.osuosl.org (Postfix) with ESMTPS id 36DCE20198 for ; Thu, 12 Sep 2019 16:55:34 +0000 (UTC) X-Originating-IP: 109.190.253.11 Received: from localhost (unknown [109.190.253.11]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E7B6620009; Thu, 12 Sep 2019 16:55:30 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List , Baruch Siach Date: Thu, 12 Sep 2019 18:55:22 +0200 Message-Id: <20190912165522.8307-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] support/scripts/pkg-stats: simplify Git commit id retrieval X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- support/scripts/pkg-stats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 6cb3a6a038..e477828f7b 100755 --- a/support/scripts/pkg-stats +++ b/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 ...")