Skip to contentSkip to conversation

autobuild-run: fix retrieving the gitid

PATCH New Yann E. MORIN 3 participants 3 messages Aug 12, 2017 – Aug 13, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autobuild-run: fix retrieving the gitid

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.

---
 scripts/autobuild-run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/autobuild-run +1 -1
index ef4f40e..406b8e5 100755
@@ -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)
 
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 autobuild-run: fix retrieving the gitid

Quoted 14 lines · Yann E. MORIN

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.

Quoted 6 lines

Also checked that there are no other similar oopses.

For me it would make sense to produce this gitid file immediately after the
fetch, but that's a different story of course.

Regards,
Arnout

Quoted 18 lines
---
 scripts/autobuild-run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/autobuild-run +1 -1
index ef4f40e..406b8e5 100755
@@ -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)
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 autobuild-run: fix retrieving the gitid

In reply to Yann E. MORIN

Hello,

Quoted 20 lines · Yann E. MORIN

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.

Quoted 3 lines
---
 scripts/autobuild-run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to buildroot-test. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com