Thread (4 messages) flat view 4 messages, 2 authors, 2021-10-11

Re: [PATCH] gitk: avoid hardcoded 40 character length for oid

From: Eric Sunshine <hidden>
Date: 2021-10-11 20:04:14

On Mon, Oct 11, 2021 at 3:56 PM Carlo Marcelo Arenas Belón
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
Current git could return ids larger than 40 characters if using
SHA-256.

Detect if the current repository does and set the oid_size to 64
instead, but fallback to 40 for backward compatibility.

Signed-off-by: Carlo Marcelo Arenas Belón <redacted>
---
diff --git a/gitk b/gitk
@@ -12338,6 +12347,18 @@ catch {
+if {![catch {exec git config --get extensions.objectformat} oid_type]
+    && $oid_type eq "sha256" } {
+    set oid_size 64
+} else {
+    set oid_type "sha1"
+    set oid_size 40
+}
Should this be using:

    git rev-parse --show-object-format

rather than `git-config`?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help