]> git.ipfire.org Git - thirdparty/git.git/commit
git-gui: Add support of SHA256 repo
authorTakashi Iwai <tiwai@suse.de>
Wed, 16 Jul 2025 07:32:25 +0000 (09:32 +0200)
committerJohannes Sixt <j6t@kdbg.org>
Wed, 16 Jul 2025 16:52:38 +0000 (18:52 +0200)
commitdab92fe42fad87a2f7067589a32ee08e70d5354b
tree0bc70a72792cbab31b9e651135ede55d6e0f4b9a
parent532a054451da6f433095405cb21b6e082a0a0a42
git-gui: Add support of SHA256 repo

This patch adds the basic support of SHA256 Git repositories.
Most of changes are idiomatic replacement of the hard-coded hash ID
length, but there are subtle things:

* The hash length is determined on startup, and stored in $hashlength
  global variable (either 40 or 64).
* The hard-coded "40" are replaced with $hashlength;
  for regexp patterns, the ugly string map is used.
* Some code have the fixed numbers like 39 and 45, and those are
  replaced with the $hashlength and the offset correction.
* $nullid and $nullid2 are generated for the hash length.

A caveat is that repository picker dialog is performed before
evaluating the repo type, hence $hashlength isn't set there yet.
So the code dealing with the hard-coded "40" are handled differently;
namely, the regexp range is expanded, and the null id is generated
from the HEAD id length locally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
git-gui.sh
lib/blame.tcl
lib/choose_repository.tcl
lib/commit.tcl
lib/remote_branch_delete.tcl