From: Johannes Sixt <j6t@kdbg.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: Denton Liu <liu.denton@gmail.com>,
Eric Huber <echuber2@illinois.edu>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Avi Halachmi <avihpit@yahoo.com>,
Christoph Sommer <sommer@cms-labs.org>,
Paul Mackerras <paulus@ozlabs.org>,
Rostislav Krasny <rosti.bsd@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH v2] gitk: Add support of SHA256 repo
Date: Mon, 14 Jul 2025 18:52:30 +0200 [thread overview]
Message-ID: <878b4335-873c-4bc5-a7c1-581d3a71901e@kdbg.org> (raw)
In-Reply-To: <20250617055957.9794-1-tiwai@suse.de>
Am 17.06.25 um 07:59 schrieb Takashi Iwai:
> This patch adds a basic support of SHA256 Git repository to Gitk, so
> that Gitk can show and operate on both SHA1 and SHA256 repos
> gracefully. Since SHA256 has a longer ID length (64 char) than SHA1
> (40 char), many field widths are adjusted to fit with it.
>
> A caveat is that the configuration of auto selection length is shared
> between SHA1 and SHA256 repos. That is, once when this value is saved
> and read, it's applied to both repo types, which may result in shorter
> selection than the full SHA256 ID. We may introduce another
> individual config for sha256 (actually I did write in the first
> version), but for simplicity, the common config is used as of writing
> this.
>
> Many lines still refer "sha1" although they may point to both SHA1 and
> SHA256. They are left untouched for making the changes simpler.
>
> This patch is based on the early work by Rostislav Krasny:
> https://patchwork.kernel.org/project/git/patch/pull.979.git.1623687519832.gitgitgadget@gmail.com
> I refreshed, revised and extended to the latest state.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>
> v1: https://lore.kernel.org/20250320154136.23262-1-tiwai@suse.de
> v1->v2:
> - Fix other procs using fixed 40 length
> - Don't use tabs
> - Drop autosellensha256 config
> - Some code simplification
> - Fix patch description
Thank you for the update. I'll queue this patch, but...
> @@ -12491,6 +12513,17 @@ if {$tclencoding == {}} {
> puts stderr "Warning: encoding $gitencoding is not supported by Tcl/Tk"
> }
>
> +# Use object format as hash algorightm (either "sha1" or "sha256")
> +set hashalgorithm [exec git rev-parse --show-object-format]
> +if {$hashalgorithm eq "sha1"} {
> + set hashlength 40
> +} elseif {$hashalgorithm eq "sha256"} {
> + set hashlength 64
> +} else {
> + puts stderr "Unknown hash algorithm: $hashalgorithm"
> + exit 1
> +}
> +
> set gui_encoding [encoding system]
> catch {
> set enc [exec git config --get gui.encoding]
... I'll move the setup of $hashlength after the gui_encoding setup that
is visible in the context, so that the new code is not in the middle of
the encoding section.
-- Hannes
prev parent reply other threads:[~2025-07-14 16:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 5:59 [PATCH v2] gitk: Add support of SHA256 repo Takashi Iwai
2025-07-14 16:52 ` Johannes Sixt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878b4335-873c-4bc5-a7c1-581d3a71901e@kdbg.org \
--to=j6t@kdbg.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=avihpit@yahoo.com \
--cc=echuber2@illinois.edu \
--cc=git@vger.kernel.org \
--cc=liu.denton@gmail.com \
--cc=paulus@ozlabs.org \
--cc=rosti.bsd@gmail.com \
--cc=sommer@cms-labs.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).