git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 11, 2021, 20:03 UTC
Message-ID
<CAPig+cQi_baTaV+Z=UJcrwS+C1dYnQ6bKEA-Bcim2VUOu8VGJA@mail.gmail.com>
In-Reply-To
<20211011195550.3355-1-carenas@gmail.com>

On Mon, Oct 11, 2021 at 3:56 PM Carlo Marcelo Arenas Belón <carenas@gmail.com> wrote:

Show 17 quoted lines
> 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 <carenas@gmail.com>
> ---
> 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`?
Previous: Carlo Marcelo Arenas BelónNext: Carlo Arenas
Message 3 of 4 in “gitk: avoid hardcoded 40 characters for oid”
  1. gitk: avoid hardcoded 40 characters for oidCarlo Marcelo Arenas Belón, Oct 11, 2021
  2. gitk: avoid hardcoded 40 character length for oidCarlo Marcelo Arenas Belón, Oct 11, 2021
  3. Eric SunshineOct 11, 2021
  4. Carlo ArenasOct 11, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.