Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package git for openSUSE:Factory checked in at 2025-07-18 15:57:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/git (Old) and /work/SRC/openSUSE:Factory/.git.new.8875 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "git" Fri Jul 18 15:57:42 2025 rev:326 rq:1294198 version:2.50.1 Changes: -------- --- /work/SRC/openSUSE:Factory/git/git.changes 2025-07-10 23:14:53.892163641 +0200 +++ /work/SRC/openSUSE:Factory/.git.new.8875/git.changes 2025-07-18 15:58:29.822387779 +0200 @@ -1,0 +2,7 @@ +Tue Jul 15 13:20:32 UTC 2025 - Takashi Iwai <ti...@suse.com> + +- update git-gui sha256 patches after the upstream review: + 0001-git-gui-Replace-null_sha1-with-nullid.patch + 0002-git-gui-Add-support-of-SHA256-repo.patch + +------------------------------------------------------------------- New: ---- 0001-git-gui-Replace-null_sha1-with-nullid.patch ----------(New B)---------- New:- update git-gui sha256 patches after the upstream review: 0001-git-gui-Replace-null_sha1-with-nullid.patch 0002-git-gui-Add-support-of-SHA256-repo.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ git.spec ++++++ --- /var/tmp/diff_new_pack.L0gBDR/_old 2025-07-18 15:58:30.698424376 +0200 +++ /var/tmp/diff_new_pack.L0gBDR/_new 2025-07-18 15:58:30.698424376 +0200 @@ -72,7 +72,8 @@ Patch11: CVE-2024-24577.patch # Add SHA256 support for gitk and git-gui (bsc#1239989) Patch20: 0001-gitk-Add-support-of-SHA256-repo.patch -Patch21: 0002-git-gui-Add-support-of-SHA256-repo.patch +Patch21: 0001-git-gui-Replace-null_sha1-with-nullid.patch +Patch22: 0002-git-gui-Add-support-of-SHA256-repo.patch BuildRequires: fdupes BuildRequires: gpg2 BuildRequires: libcurl-devel ++++++ 0001-git-gui-Replace-null_sha1-with-nullid.patch ++++++ >From c0c016a2d63fc834a26ebf50e7940a1cf58e7b64 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <ti...@suse.de> Date: Tue, 15 Jul 2025 14:14:19 +0200 Subject: [PATCH 1/2] git-gui: Replace null_sha1 with nullid Both $nullid and $null_sha1 point to the same content. Use only $nullid consistently. This is a preliminary cleanup for adding the support of SHA256 repo. Signed-off-by: Takashi Iwai <ti...@suse.de> --- git-gui/git-gui.sh | 5 ++--- git-gui/lib/checkout_op.tcl | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index c77c05edde3b..413a8a9abc1f 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -1845,10 +1845,9 @@ proc short_path {path} { } set next_icon_id 0 -set null_sha1 [string repeat 0 40] proc merge_state {path new_state {head_info {}} {index_info {}}} { - global file_states next_icon_id null_sha1 + global file_states next_icon_id nullid set s0 [string index $new_state 0] set s1 [string index $new_state 1] @@ -1870,7 +1869,7 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} { elseif {$s1 eq {_}} {set s1 _} if {$s0 eq {A} && $s1 eq {_} && $head_info eq {}} { - set head_info [list 0 $null_sha1] + set head_info [list 0 $nullid] } elseif {$s0 ne {_} && [string index $state 0] eq {_} && $head_info eq {}} { set head_info $index_info diff --git a/git-gui/lib/checkout_op.tcl b/git-gui/lib/checkout_op.tcl index 87ed0b48585e..987486a4b602 100644 --- a/git-gui/lib/checkout_op.tcl +++ b/git-gui/lib/checkout_op.tcl @@ -151,7 +151,7 @@ method _finish_fetch {ok} { } method _update_ref {} { - global null_sha1 current_branch repo_config + global nullid current_branch repo_config set ref $new_ref set new $new_hash @@ -177,7 +177,7 @@ method _update_ref {} { } set reflog_msg "branch: Created from $new_expr" - set cur $null_sha1 + set cur $nullid if {($repo_config(branch.autosetupmerge) eq {true} || $repo_config(branch.autosetupmerge) eq {always}) -- 2.50.1 ++++++ 0002-git-gui-Add-support-of-SHA256-repo.patch ++++++ --- /var/tmp/diff_new_pack.L0gBDR/_old 2025-07-18 15:58:30.742426215 +0200 +++ /var/tmp/diff_new_pack.L0gBDR/_new 2025-07-18 15:58:30.746426382 +0200 @@ -1,31 +1,45 @@ -From 36516ccae8af702640d900067998f4c7310d5b05 Mon Sep 17 00:00:00 2001 +From e5f0641ca545cb7eac73c1dedcf98fbd99db6f52 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <ti...@suse.de> Date: Fri, 13 Jun 2025 17:36:34 +0200 -Subject: [PATCH] git-gui: Add support of SHA256 repo +Subject: [PATCH 2/2] git-gui: Add support of SHA256 repo This patch adds the basic support of SHA256 Git repositories. -The needed changes were mostly about adjusting the fixed ID length of -SHA1 (40) to be variable depending on the repo type. +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 <ti...@suse.de> --- - git-gui/git-gui.sh | 13 ++++++++++++- + git-gui/git-gui.sh | 17 ++++++++++++++--- git-gui/lib/blame.tcl | 12 ++++++++---- - git-gui/lib/choose_repository.tcl | 8 ++++++-- + git-gui/lib/choose_repository.tcl | 7 ++++--- git-gui/lib/commit.tcl | 3 ++- git-gui/lib/remote_branch_delete.tcl | 4 +++- - 5 files changed, 31 insertions(+), 9 deletions(-) + 5 files changed, 31 insertions(+), 12 deletions(-) -Index: git/git-gui/git-gui.sh -=================================================================== ---- git.orig/git-gui/git-gui.sh -+++ git/git-gui/git-gui.sh +diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh +index 413a8a9abc1f..c437980927fd 100755 +--- a/git-gui/git-gui.sh ++++ b/git-gui/git-gui.sh @@ -1298,6 +1298,17 @@ if {[catch { set picked 1 } -+# Use object format as hash algorightm (either "sha1" or "sha256") -+set hashalgorithm [exec git rev-parse --show-object-format] ++# Use object format as hash algorithm (either "sha1" or "sha256") ++set hashalgorithm [git rev-parse --show-object-format] +if {$hashalgorithm eq "sha1"} { + set hashlength 40 +} elseif {$hashalgorithm eq "sha256"} { @@ -38,19 +52,30 @@ # we expand the _gitdir when it's just a single dot (i.e. when we're being # run from the .git dir itself) lest the routines to find the worktree # get confused -@@ -1845,7 +1856,7 @@ proc short_path {path} { - } - - set next_icon_id 0 --set null_sha1 [string repeat 0 40] -+set null_sha1 [string repeat 0 $hashlength] - - proc merge_state {path new_state {head_info {}} {index_info {}}} { - global file_states next_icon_id null_sha1 -Index: git/git-gui/lib/blame.tcl -=================================================================== ---- git.orig/git-gui/lib/blame.tcl -+++ git/git-gui/lib/blame.tcl +@@ -1391,8 +1402,8 @@ set is_conflict_diff 0 + set last_revert {} + set last_revert_enc {} + +-set nullid "0000000000000000000000000000000000000000" +-set nullid2 "0000000000000000000000000000000000000001" ++set nullid [string repeat 0 $hashlength] ++set nullid2 "[string repeat 0 [expr $hashlength - 1]]1" + + ###################################################################### + ## +@@ -3202,7 +3213,7 @@ blame { + if {$head eq {}} { + load_current_branch + } else { +- if {[regexp {^[0-9a-f]{1,39}$} $head]} { ++ if {[regexp [string map "@@ [expr $hashlength - 1]" {^[0-9a-f]{1,@@}$}] $head]} { + if {[catch { + set head [git rev-parse --verify $head] + } err]} { +diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl +index d6fd8bea91ff..5507681da7ba 100644 +--- a/git-gui/lib/blame.tcl ++++ b/git-gui/lib/blame.tcl @@ -426,6 +426,7 @@ method _kill {} { method _load {jump} { @@ -86,11 +111,11 @@ set t [string range $c 0 8]... } elseif {$c eq {}} { set t {Working Directory} -@@ -627,6 +630,7 @@ method _exec_blame {cur_w cur_d options +@@ -627,6 +630,7 @@ method _exec_blame {cur_w cur_d options cur_s} { method _read_blame {fd cur_w cur_d} { upvar #0 $cur_d line_data variable group_colors -+ global hashlength ++ global hashlength nullid if {$fd ne $current_fd} { catch {close $fd} @@ -108,55 +133,40 @@ set cmit $r_commit - if {[regexp {^0{40}$} $cmit]} { -+ if {[regexp [string map "@@ $hashlength" {^0{@@}$}] $cmit]} { ++ if {$cmit eq $nullid} { set commit_abbr work set commit_type curr_commit } elseif {$cmit eq $commit} { -Index: git/git-gui/lib/choose_repository.tcl -=================================================================== ---- git.orig/git-gui/lib/choose_repository.tcl -+++ git/git-gui/lib/choose_repository.tcl -@@ -870,6 +870,8 @@ method _do_clone_HEAD {ok} { - } - - method _do_clone_full_end {ok} { -+ global hashlength -+ - $o_cons done $ok - - if {$ok} { -@@ -879,7 +881,7 @@ method _do_clone_full_end {ok} { +diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl +index 5b361cc424a6..877ca4888f7a 100644 +--- a/git-gui/lib/choose_repository.tcl ++++ b/git-gui/lib/choose_repository.tcl +@@ -879,7 +879,7 @@ method _do_clone_full_end {ok} { if {[file exists [gitdir FETCH_HEAD]]} { set fd [safe_open_file [gitdir FETCH_HEAD] r] while {[gets $fd line] >= 0} { - if {[regexp "^(.{40})\t\t" $line line HEAD]} { -+ if {[regexp [string map "@@ $hashlength" "^(.{@@})\t\t"] $line line HEAD]} { ++ if {[regexp "^(.{40,64})\t\t" $line line HEAD]} { break } } -@@ -966,6 +968,8 @@ method _do_clone_checkout {HEAD} { - } - - method _readtree_wait {fd} { -+ global hashlength -+ - set buf [read $fd] - $o_status_op update_meter $buf - append readtree_err $buf -@@ -987,7 +991,7 @@ method _readtree_wait {fd} { +@@ -987,8 +987,9 @@ method _readtree_wait {fd} { # -- Run the post-checkout hook. # - set fd_ph [githook_read post-checkout [string repeat 0 40] \ -+ set fd_ph [githook_read post-checkout [string repeat 0 $hashlength] \ - [git rev-parse HEAD] 1] +- [git rev-parse HEAD] 1] ++ set head_id [git rev-parse HEAD] ++ set fd_ph [githook_read post-checkout \ ++ [string repeat 0 [string length $head_id]] $head_id 1] if {$fd_ph ne {}} { global pch_error -Index: git/git-gui/lib/commit.tcl -=================================================================== ---- git.orig/git-gui/lib/commit.tcl -+++ git/git-gui/lib/commit.tcl -@@ -348,6 +348,7 @@ proc commit_committree {fd_wt curHEAD ms + set pch_error {} +diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl +index 60d66172a100..7c800a4bc37a 100644 +--- a/git-gui/lib/commit.tcl ++++ b/git-gui/lib/commit.tcl +@@ -348,6 +348,7 @@ proc commit_committree {fd_wt curHEAD msg_p} { global file_states selected_paths rescan_active global repo_config global env @@ -164,7 +174,7 @@ gets $fd_wt tree_id if {[catch {close $fd_wt} err]} { -@@ -367,7 +368,7 @@ proc commit_committree {fd_wt curHEAD ms +@@ -367,7 +368,7 @@ proc commit_committree {fd_wt curHEAD msg_p} { close $fd_ot if {[string equal -length 5 {tree } $old_tree] @@ -173,10 +183,10 @@ set old_tree [string range $old_tree 5 end] } else { error [mc "Commit %s appears to be corrupt" $PARENT] -Index: git/git-gui/lib/remote_branch_delete.tcl -=================================================================== ---- git.orig/git-gui/lib/remote_branch_delete.tcl -+++ git/git-gui/lib/remote_branch_delete.tcl +diff --git a/git-gui/lib/remote_branch_delete.tcl b/git-gui/lib/remote_branch_delete.tcl +index c8c99b17a8da..781980d66cc8 100644 +--- a/git-gui/lib/remote_branch_delete.tcl ++++ b/git-gui/lib/remote_branch_delete.tcl @@ -323,6 +323,8 @@ method _load {cache uri} { } @@ -195,4 +205,7 @@ if {[regsub ^refs/heads/ $ref {} abr]} { lappend head_list $abr lappend head_cache($cache) $abr +-- +2.50.1 +