support/scripts/pkg-stats: extract current commit id, not master
PATCH 1/1 support/scripts/pkg-stats: extract current commit id, not master
pkg-stats extracts the Buildroot commit id from which the package information was collected. However, when doing so, it always assumes we're using the master branch, by running "git log master".
But in fact, pkg-stats can be run from any branch/tag, so it makes a lot more sense to use "git log HEAD".
---
As was discussed with Baruch and others, the page at
http://autobuild.buildroot.net/stats/ now shows the results corresponding to the next branch when such a branch exists. However, the commit ID currently shown at the bottom of the page is incorrect, as it shows the one of the master branch at the time the page was generated.
--- support/scripts/pkg-stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/pkg-stats +1 -1
@@ -727,7 +727,7 @@ def __main__(): else: package_list = None date = datetime.datetime.utcnow() - commit = subprocess.check_output(['git', 'log', 'master', '-n', '1', + commit = subprocess.check_output(['git', 'log', 'HEAD', '-n', '1', '--pretty=format:%H']).splitlines()[0] print("Build package list ...") packages = get_pkglist(args.npackages, package_list)
Signature · 1 line
2.21.0
PATCH 1/1 support/scripts/pkg-stats: extract current commit id, not master
Hi Thomas,
Quoted 26 lines · Thomas Petazzoni
pkg-stats extracts the Buildroot commit id from which the package information was collected. However, when doing so, it always assumes we're using the master branch, by running "git log master".
But in fact, pkg-stats can be run from any branch/tag, so it makes a lot more sense to use "git log HEAD".
Cc victor.huesca at bootlin.comCc Baruch Siach <[email protected]>Signed-off-by Thomas Petazzoni <[email protected]>---
As was discussed with Baruch and others, the page at
http://autobuild.buildroot.net/stats/ now shows the results corresponding to the next branch when such a branch exists. However, the commit ID currently shown at the bottom of the page is incorrect, as it shows the one of the master branch at the time the page was generated.--- support/scripts/pkg-stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)support/scripts/pkg-stats +0
-0
support/scripts/pkg-stats def __main__(): · line 731
Quoted 6 lines
support/scripts/pkg-stats +1
-1@@ -727,7 +727,7 @@ def __main__(): else: package_list = None date = datetime.datetime.utcnow() - commit = subprocess.check_output(['git', 'log', 'master', '-n', '1', + commit = subprocess.check_output(['git', 'log', 'HEAD', '-n', '1', '--pretty=format:%H']).splitlines()[0]
Unrelated to this patch, commit id retrieval can be simplified to just:
git rev-parse HEAD
baruch
Quoted 2 lines
support/scripts/pkg-stats +0
-0print("Build package list ...") packages = get_pkglist(args.npackages, package_list)
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 1/1 support/scripts/pkg-stats: extract current commit id, not master
Quoted 3 lines · On Thu, 29 Aug 2019 10:29:29 +0300 Baruch Siach <[email protected]> wrote:
Unrelated to this patch, commit id retrieval can be simplified to just:
git rev-parse HEAD
Good point, I sent a follow-up patch doing exactly this. Thanks for the suggestion!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Thomas Petazzoni
AppliedPATCH 1/1 support/scripts/pkg-stats: extract current commit id, not master
In reply to Thomas PetazzoniQuoted 17 lines · On Thu, 29 Aug 2019 09:22:33 +0200 Thomas Petazzoni…
pkg-stats extracts the Buildroot commit id from which the package information was collected. However, when doing so, it always assumes we're using the master branch, by running "git log master".
But in fact, pkg-stats can be run from any branch/tag, so it makes a lot more sense to use "git log HEAD".
Cc victor.huesca at bootlin.comCc Baruch Siach <[email protected]>Signed-off-by Thomas Petazzoni <[email protected]>---
As was discussed with Baruch and others, the page at
http://autobuild.buildroot.net/stats/ now shows the results corresponding to the next branch when such a branch exists. However, the commit ID currently shown at the bottom of the page is incorrect, as it shows the one of the master branch at the time the page was generated.
Quoted 3 lines
--- support/scripts/pkg-stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com