[Buildroot] [PATCH] autobuild-run: fix retrieving the gitid

Yann E. MORIN yann.morin.1998 at free.fr
Sat Aug 12 09:49:43 UTC 2017


Before 66f91eb (autobuild-run: add --repo option), we used to 'git pull'
to update the local Buildroot clone. This had the side-effect of
updating the local refs because we were pulling from 'origin'.

So 'origin/master' and 'master' were correctly updated.

But since the offending commit, we no longer pull, and we instead fetch
from an explicit repository, which never updates 'origin/master' nor
'master'. Instead, they both are stuck at the time the repository was
cloned, or at the time the autobuild script was updated.

We fix that by just dropping the 'master' ref from the git log so that
the log applies to the commit for current working copy.

Reported-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Reported-by: Bernd Kuhls <bernd.kuhls at t-online.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Cc: Bernd Kuhls <bernd.kuhls at t-online.de>
Cc: Arnout Vandecappelle <arnout at mind.be>
---
 scripts/autobuild-run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index ef4f40e..406b8e5 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -409,7 +409,7 @@ def send_results(result, **kwargs):
         shutil.copyfile(os.path.join(outputdir, "legal-info", "manifest.csv"),
                         os.path.join(resultdir, "licenses-manifest.csv"))
 
-    subprocess.call(["git log master -n 1 --pretty=format:%%H > %s" % \
+    subprocess.call(["git log -n 1 --pretty=format:%%H > %s" % \
                      os.path.join(resultdir, "gitid")],
                     shell=True, cwd=srcdir)
 
-- 
2.11.0



More information about the buildroot mailing list