Skip to contentSkip to conversation

lib/oe/reproducible: Use git log without gpg signature

PATCH In review Benoît Mauduit 3 participants 4 messages Jan 12, 2023 – Feb 25, 2023 2 messages not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 lib/oe/reproducible: Use git log without gpg signature

In reply to a message not in the archive

Previously, if "showSignature" is present in user gitconfig, parsing of the timestamp will fail.

Ideally we should replace this command with a git plumbing command.

---
 meta/lib/oe/reproducible.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oe/reproducible.py +2 -1
index 04a1810d4f2..9ac75c02e38 100644
@@ -115,7 +115,8 @@ def get_source_date_epoch_from_git(d, sourcedir):
         return None
 
     bb.debug(1, "git repository: %s" % gitpath)
-    p = subprocess.run(['git', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'], check=True, stdout=subprocess.PIPE)
+    p = subprocess.run(['git', '-c', 'log.showSignature=false', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'],
+                       check=True, stdout=subprocess.PIPE)
     return int(p.stdout.decode('utf-8'))
 
 def get_source_date_epoch_from_youngest_file(d, sourcedir):
Signature · 1 line
2.39.0
#2 lore raw

Hello,

please send this to the oe-core mailing list, as changes in poky/meta/ should go there. It's something of a historical baggage :-)

Alex

Quoted 31 lines · Benoît Mauduit via lists.yoctoproject.org

Previously, if "showSignature" is present in user gitconfig, parsing of the timestamp will fail.

Ideally we should replace this command with a git plumbing command.

---
 meta/lib/oe/reproducible.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oe/reproducible.py +2 -2
index 04a1810d4f2..9ac75c02e38 100644
@@ -115,7 +115,8 @@ def get_source_date_epoch_from_git(d, sourcedir):
         return None
 
     bb.debug(1, "git repository: %s" % gitpath)
-    p = subprocess.run(['git', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'], check=True, stdout=subprocess.PIPE)
+    p = subprocess.run(['git', '-c', 'log.showSignature=false', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'],
+                       check=True, stdout=subprocess.PIPE)
     return int(p.stdout.decode('utf-8'))
 
 def get_source_date_epoch_from_youngest_file(d, sourcedir):
--

2.39.0

#4 lore raw
In reply to a message not in the archive

Hello,

Any update on my patch ?

Thanks,

BR,

Quoted 35 lines · Benoît Mauduit via lists.openembedded.org

Previously, if "showSignature" is present in user gitconfig, parsing of the timestamp will fail.

Ideally we should replace this command with a git plumbing command.

---
  meta/lib/oe/reproducible.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oe/reproducible.py +2 -2
index 04a1810d4f2..9ac75c02e38 100644
@@ -115,7 +115,8 @@ def get_source_date_epoch_from_git(d, sourcedir):
          return None
 
      bb.debug(1, "git repository: %s" % gitpath)
-    p = subprocess.run(['git', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'], check=True, stdout=subprocess.PIPE)
+    p = subprocess.run(['git', '-c', 'log.showSignature=false', '--git-dir', gitpath, 'log', '-1', '--pretty=%ct'],
+                       check=True, stdout=subprocess.PIPE)
      return int(p.stdout.decode('utf-8'))
 
  def get_source_date_epoch_from_youngest_file(d, sourcedir):
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#175795): https://lists.openembedded.org/g/openembedded-core/message/175795
Mute This Topic: https://lists.openembedded.org/mt/96222114/7398344
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Benoît Mauduit
<[email protected]>