Accepting request 1286266 from home:tiwai:branches:devel:tools:scm

- Refresh gitk SHA256 patch and add SHA256 support to git-gui (bsc#1239989):
  0001-gitk-Add-support-of-SHA256-repo.patch
  0002-git-gui-Add-support-of-SHA256-repo.patch
  The previous patches are dropped:
  0001-gitk-Add-a-basic-support-of-SHA256-repositories-into.patch
  0002-gitk-Add-auto-select-length-preference-for-SHA256.patch

OBS-URL: https://build.opensuse.org/request/show/1286266
OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/git?expand=0&rev=672
This commit is contained in:
2025-06-17 11:02:00 +00:00
committed by Git OBS Bridge
commit b54fb42c5f
40 changed files with 7901 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,282 @@
From bf31d29be1c753d1f6c73c3477fb6040ef4341ce Mon Sep 17 00:00:00 2001
From: Rostislav Krasny <rosti.bsd@gmail.com>
Date: Mon, 14 Jun 2021 16:18:39 +0000
Subject: [PATCH 1/2] gitk: Add a basic support of SHA256 repositories into
Gitk
This PR makes Gitk working on both SHA256 and SHA1 repositories without
errors/crashes. I made it by changing and testing the gitk script of Git
for Windows [https://gitforwindows.org/] version 2.32.0.windows.1 that
is a little bit different than the mainstream 2.32.0 version.
Still not fixed functionality: [1] There is the "Auto-select SHA1
(length)" configuration preference that affects "Copy commit reference"
on both SHA1 and SHA256 repositories.
A new "Auto-select SHA256 (length)" configuration preference should be
added and used on SHA256 repositories instead of the old one. Since I'm
not familiar with Tcl/Tk and this issue isn't critical I didn't
implement it.
[ Changes from the original patch:
* Discard the changes for generic words (e.g. "Commit ID"), so that
translations can be still applied after this patch
* Simplify the regexp check in gotocommit as suggested in the
previous review
-- tiwai ]
Signed-off-by: Rostislav Krasny <rosti.bsd@gmail.com>
Link: https://patchwork.kernel.org/project/git/patch/pull.979.git.1623687519832.gitgitgadget@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
gitk-git/gitk | 59 +++++++++++++++++++++++++++++++++++++--------------
1 file changed, 43 insertions(+), 16 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index bc9efa18566f..1e85cfef2ee3 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -425,6 +425,7 @@ proc parseviewargs {n arglist} {
proc parseviewrevs {view revs} {
global vposids vnegids
+ global hashlength
if {$revs eq {}} {
set revs HEAD
@@ -438,7 +439,7 @@ proc parseviewrevs {view revs} {
set badrev {}
for {set l 0} {$l < [llength $errlines]} {incr l} {
set line [lindex $errlines $l]
- if {!([string length $line] == 40 && [string is xdigit $line])} {
+ if {!([string length $line] == $hashlength && [string is xdigit $line])} {
if {[string match "fatal:*" $line]} {
if {[string match "fatal: ambiguous argument*" $line]
&& $badrev ne {}} {
@@ -655,6 +656,7 @@ proc updatecommits {} {
global hasworktree
global varcid vposids vnegids vflags vrevs
global show_notes
+ global hashlength
set hasworktree [hasworktree]
rereadrefs
@@ -688,7 +690,7 @@ proc updatecommits {} {
# take out positive refs that we asked for before or
# that we have already seen
foreach rev $revs {
- if {[string length $rev] == 40} {
+ if {[string length $rev] == $hashlength} {
if {[lsearch -exact $oldpos $rev] < 0
&& ![info exists varcid($view,$rev)]} {
lappend newrevs $rev
@@ -1573,6 +1575,7 @@ proc getcommitlines {fd inst view updating} {
global parents children curview hlview
global idpending ordertok
global varccommits varcid varctok vtokmod vfilelimit vshortids
+ global hashlength
set stuff [read $fd 500000]
# git log doesn't terminate the last commit with a null...
@@ -1655,7 +1658,7 @@ proc getcommitlines {fd inst view updating} {
}
set ok 1
foreach id $ids {
- if {[string length $id] != 40} {
+ if {[string length $id] != $hashlength} {
set ok 0
break
}
@@ -1935,6 +1938,7 @@ proc readrefs {} {
global selecthead selectheadid
global hideremotes
global tclencoding
+ global hashlength
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
unset -nocomplain $v
@@ -1944,9 +1948,9 @@ proc readrefs {} {
fconfigure $refd -encoding $tclencoding
}
while {[gets $refd line] >= 0} {
- if {[string index $line 40] ne " "} continue
- set id [string range $line 0 39]
- set ref [string range $line 41 end]
+ if {[string index $line $hashlength] ne " "} continue
+ set id [string range $line 0 [expr {$hashlength - 1}]]
+ set ref [string range $line [expr {$hashlength + 1}] end]
if {![string match "refs/*" $ref]} continue
set name [string range $ref 5 end]
if {[string match "remotes/*" $name]} {
@@ -2241,6 +2245,7 @@ proc makewindow {} {
global have_tk85 have_tk86 use_ttk NS
global git_version
global worddiff
+ global hashlength
# The "mc" arguments here are purely so that xgettext
# sees the following string as needing to be translated
@@ -2366,7 +2371,7 @@ proc makewindow {} {
-command gotocommit -width 8
$sha1but conf -disabledforeground [$sha1but cget -foreground]
pack .tf.bar.sha1label -side left
- ${NS}::entry $sha1entry -width 40 -font textfont -textvariable sha1string
+ ${NS}::entry $sha1entry -width $hashlength -font textfont -textvariable sha1string
trace add variable sha1string write sha1change
pack $sha1entry -side left -pady 2
@@ -4093,6 +4098,7 @@ proc stopblaming {} {
proc read_line_source {fd inst} {
global blamestuff curview commfd blameinst nullid nullid2
+ global hashlength
while {[gets $fd line] >= 0} {
lappend blamestuff($inst) $line
@@ -4113,7 +4119,7 @@ proc read_line_source {fd inst} {
set line [split [lindex $blamestuff($inst) 0] " "]
set id [lindex $line 0]
set lnum [lindex $line 1]
- if {[string length $id] == 40 && [string is xdigit $id] &&
+ if {[string length $id] == $hashlength && [string is xdigit $id] &&
[string is digit -strict $lnum]} {
# look for "filename" line
foreach l $blamestuff($inst) {
@@ -5436,13 +5442,14 @@ proc get_viewmainhead {view} {
# git rev-list should give us just 1 line to use as viewmainheadid($view)
proc getviewhead {fd inst view} {
global viewmainheadid commfd curview viewinstances showlocalchanges
+ global hashlength
set id {}
if {[gets $fd line] < 0} {
if {![eof $fd]} {
return 1
}
- } elseif {[string length $line] == 40 && [string is xdigit $line]} {
+ } elseif {[string length $line] == $hashlength && [string is xdigit $line]} {
set id $line
}
set viewmainheadid($view) $id
@@ -7206,10 +7213,11 @@ proc commit_descriptor {p} {
# Also look for URLs of the form "http[s]://..." and make them web links.
proc appendwithlinks {text tags} {
global ctext linknum curview
+ global hashlength
set start [$ctext index "end - 1c"]
$ctext insert end $text $tags
- set links [regexp -indices -all -inline {(?:\m|-g)[0-9a-f]{6,40}\M} $text]
+ set links [regexp -indices -all -inline [string map "@@ $hashlength" {(?:\m|-g)[0-9a-f]{6,@@}\M}] $text]
foreach l $links {
set s [lindex $l 0]
set e [lindex $l 1]
@@ -8888,13 +8896,16 @@ proc incrfont {inc} {
proc clearsha1 {} {
global sha1entry sha1string
- if {[string length $sha1string] == 40} {
+ global hashlength
+
+ if {[string length $sha1string] == $hashlength} {
$sha1entry delete 0 end
}
}
proc sha1change {n1 n2 op} {
global sha1string currentid sha1but
+
if {$sha1string == {}
|| ([info exists currentid] && $sha1string == $currentid)} {
set state disabled
@@ -8911,6 +8922,7 @@ proc sha1change {n1 n2 op} {
proc gotocommit {} {
global sha1string tagids headids curview varcid
+ global hashlength
if {$sha1string == {}
|| ([info exists currentid] && $sha1string == $currentid)} return
@@ -8920,11 +8932,11 @@ proc gotocommit {} {
set id $headids($sha1string)
} else {
set id [string tolower $sha1string]
- if {[regexp {^[0-9a-f]{4,39}$} $id]} {
+ if {[regexp {^[0-9a-f]{4,63}$} $id]} {
set matches [longid $id]
if {$matches ne {}} {
if {[llength $matches] > 1} {
- error_popup [mc "Short commit ID %s is ambiguous" $id]
+ error_popup [mc "Short commit id %s is ambiguous" $id]
return
}
set id [lindex $matches 0]
@@ -9618,10 +9630,11 @@ proc mktaggo {} {
proc copyreference {} {
global rowmenuid autosellen
+ global hashlength
set format "%h (\"%s\", %ad)"
set cmd [list git show -s --pretty=format:$format --date=short]
- if {$autosellen < 40} {
+ if {$autosellen < $hashlength} {
lappend cmd --abbrev=$autosellen
}
set reference [eval exec $cmd $rowmenuid]
@@ -9632,6 +9645,7 @@ proc copyreference {} {
proc writecommit {} {
global rowmenuid wrcomtop commitinfo wrcomcmd NS
+ global hashlength
set top .writecommit
set wrcomtop $top
@@ -9641,7 +9655,7 @@ proc writecommit {} {
${NS}::label $top.title -text [mc "Write commit to file"]
grid $top.title - -pady 10
${NS}::label $top.id -text [mc "ID:"]
- ${NS}::entry $top.sha1 -width 40
+ ${NS}::entry $top.sha1 -width $hashlength
$top.sha1 insert 0 $rowmenuid
$top.sha1 conf -state readonly
grid $top.id $top.sha1 -sticky w
@@ -9721,6 +9735,7 @@ proc mvbranch {} {
proc branchdia {top valvar uivar} {
global NS commitinfo
+ global hashlength
upvar $valvar val $uivar ui
catch {destroy $top}
@@ -9729,7 +9744,7 @@ proc branchdia {top valvar uivar} {
${NS}::label $top.title -text $ui(title)
grid $top.title - -pady 10
${NS}::label $top.id -text [mc "ID:"]
- ${NS}::entry $top.sha1 -width 40
+ ${NS}::entry $top.sha1 -width $hashlength
$top.sha1 insert 0 $val(id)
$top.sha1 conf -state readonly
grid $top.id $top.sha1 -sticky w
@@ -12524,6 +12539,18 @@ if {$tclencoding == {}} {
puts stderr "Warning: encoding $gitencoding is not supported by Tcl/Tk"
}
+set objformat [exec git rev-parse --show-object-format]
+if {$objformat eq "sha1"} {
+ set hashlength 40
+} elseif {$objformat eq "sha256"} {
+ set hashlength 64
+} else {
+ error_popup "[mc "Not supported hash algorithm:"] {$objformat}"
+ exit 1
+}
+set hashalgorithm [string toupper $objformat]
+unset objformat
+
set gui_encoding [encoding system]
catch {
set enc [exec git config --get gui.encoding]
--
2.49.0

View File

@@ -0,0 +1,402 @@
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH v2] gitk: Add support of SHA256 repo
Date: Tue, 17 Jun 2025 07:59:54 +0200
Message-ID: <20250617055957.9794-1-tiwai@suse.de>
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
gitk-git/gitk | 83 +++++++++++++++++++++++++++++++++++----------------
1 file changed, 58 insertions(+), 25 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 19689765cde5..04f5f5face68 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -394,6 +394,7 @@ proc parseviewargs {n arglist} {
proc parseviewrevs {view revs} {
global vposids vnegids
+ global hashlength
if {$revs eq {}} {
set revs HEAD
@@ -407,7 +408,7 @@ proc parseviewrevs {view revs} {
set badrev {}
for {set l 0} {$l < [llength $errlines]} {incr l} {
set line [lindex $errlines $l]
- if {!([string length $line] == 40 && [string is xdigit $line])} {
+ if {!([string length $line] == $hashlength && [string is xdigit $line])} {
if {[string match "fatal:*" $line]} {
if {[string match "fatal: ambiguous argument*" $line]
&& $badrev ne {}} {
@@ -624,6 +625,7 @@ proc updatecommits {} {
global hasworktree
global varcid vposids vnegids vflags vrevs
global show_notes
+ global hashlength
set hasworktree [hasworktree]
rereadrefs
@@ -657,7 +659,7 @@ proc updatecommits {} {
# take out positive refs that we asked for before or
# that we have already seen
foreach rev $revs {
- if {[string length $rev] == 40} {
+ if {[string length $rev] == $hashlength} {
if {[lsearch -exact $oldpos $rev] < 0
&& ![info exists varcid($view,$rev)]} {
lappend newrevs $rev
@@ -1542,6 +1544,7 @@ proc getcommitlines {fd inst view updating} {
global parents children curview hlview
global idpending ordertok
global varccommits varcid varctok vtokmod vfilelimit vshortids
+ global hashlength
set stuff [read $fd 500000]
# git log doesn't terminate the last commit with a null...
@@ -1624,7 +1627,7 @@ proc getcommitlines {fd inst view updating} {
}
set ok 1
foreach id $ids {
- if {[string length $id] != 40} {
+ if {[string length $id] != $hashlength} {
set ok 0
break
}
@@ -1870,8 +1873,8 @@ proc getcommit {id} {
return 1
}
-# Expand an abbreviated commit ID to a list of full 40-char IDs that match
-# and are present in the current view.
+# Expand an abbreviated commit ID to a list of full 40-char (or 64-char
+# for SHA256 repo) IDs that match and are present in the current view.
# This is fairly slow...
proc longid {prefix} {
global varcid curview vshortids
@@ -1904,6 +1907,7 @@ proc readrefs {} {
global selecthead selectheadid
global hideremotes
global tclencoding
+ global hashlength
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
unset -nocomplain $v
@@ -1913,9 +1917,9 @@ proc readrefs {} {
fconfigure $refd -encoding $tclencoding
}
while {[gets $refd line] >= 0} {
- if {[string index $line 40] ne " "} continue
- set id [string range $line 0 39]
- set ref [string range $line 41 end]
+ if {[string index $line $hashlength] ne " "} continue
+ set id [string range $line 0 [expr {$hashlength - 1}]]
+ set ref [string range $line [expr {$hashlength + 1}] end]
if {![string match "refs/*" $ref]} continue
set name [string range $ref 5 end]
if {[string match "remotes/*" $name]} {
@@ -2210,6 +2214,7 @@ proc makewindow {} {
global have_tk85 have_tk86 use_ttk NS
global git_version
global worddiff
+ global hashlength
# The "mc" arguments here are purely so that xgettext
# sees the following string as needing to be translated
@@ -2335,7 +2340,7 @@ proc makewindow {} {
-command gotocommit -width 8
$sha1but conf -disabledforeground [$sha1but cget -foreground]
pack .tf.bar.sha1label -side left
- ${NS}::entry $sha1entry -width 40 -font textfont -textvariable sha1string
+ ${NS}::entry $sha1entry -width $hashlength -font textfont -textvariable sha1string
trace add variable sha1string write sha1change
pack $sha1entry -side left -pady 2
@@ -4062,6 +4067,7 @@ proc stopblaming {} {
proc read_line_source {fd inst} {
global blamestuff curview commfd blameinst nullid nullid2
+ global hashlength
while {[gets $fd line] >= 0} {
lappend blamestuff($inst) $line
@@ -4082,7 +4088,7 @@ proc read_line_source {fd inst} {
set line [split [lindex $blamestuff($inst) 0] " "]
set id [lindex $line 0]
set lnum [lindex $line 1]
- if {[string length $id] == 40 && [string is xdigit $id] &&
+ if {[string length $id] == $hashlength && [string is xdigit $id] &&
[string is digit -strict $lnum]} {
# look for "filename" line
foreach l $blamestuff($inst) {
@@ -5226,11 +5232,13 @@ proc askrelhighlight {row id} {
# Graph layout functions
proc shortids {ids} {
+ global hashlength
+
set res {}
foreach id $ids {
if {[llength $id] > 1} {
lappend res [shortids $id]
- } elseif {[regexp {^[0-9a-f]{40}$} $id]} {
+ } elseif {[regexp [string map "@@ $hashlength" {^[0-9a-f]{@@}$}] $id]} {
lappend res [string range $id 0 7]
} else {
lappend res $id
@@ -5405,13 +5413,14 @@ proc get_viewmainhead {view} {
# git rev-list should give us just 1 line to use as viewmainheadid($view)
proc getviewhead {fd inst view} {
global viewmainheadid commfd curview viewinstances showlocalchanges
+ global hashlength
set id {}
if {[gets $fd line] < 0} {
if {![eof $fd]} {
return 1
}
- } elseif {[string length $line] == 40 && [string is xdigit $line]} {
+ } elseif {[string length $line] == $hashlength && [string is xdigit $line]} {
set id $line
}
set viewmainheadid($view) $id
@@ -7175,10 +7184,11 @@ proc commit_descriptor {p} {
# Also look for URLs of the form "http[s]://..." and make them web links.
proc appendwithlinks {text tags} {
global ctext linknum curview
+ global hashlength
set start [$ctext index "end - 1c"]
$ctext insert end $text $tags
- set links [regexp -indices -all -inline {(?:\m|-g)[0-9a-f]{6,40}\M} $text]
+ set links [regexp -indices -all -inline [string map "@@ $hashlength" {(?:\m|-g)[0-9a-f]{6,@@}\M}] $text]
foreach l $links {
set s [lindex $l 0]
set e [lindex $l 1]
@@ -7206,13 +7216,14 @@ proc appendwithlinks {text tags} {
proc setlink {id lk} {
global curview ctext pendinglinks
global linkfgcolor
+ global hashlength
if {[string range $id 0 1] eq "-g"} {
set id [string range $id 2 end]
}
set known 0
- if {[string length $id] < 40} {
+ if {[string length $id] < $hashlength} {
set matches [longid $id]
if {[llength $matches] > 0} {
if {[llength $matches] > 1} return
@@ -8857,13 +8868,16 @@ proc incrfont {inc} {
proc clearsha1 {} {
global sha1entry sha1string
- if {[string length $sha1string] == 40} {
+ global hashlength
+
+ if {[string length $sha1string] == $hashlength} {
$sha1entry delete 0 end
}
}
proc sha1change {n1 n2 op} {
global sha1string currentid sha1but
+
if {$sha1string == {}
|| ([info exists currentid] && $sha1string == $currentid)} {
set state disabled
@@ -8880,6 +8894,7 @@ proc sha1change {n1 n2 op} {
proc gotocommit {} {
global sha1string tagids headids curview varcid
+ global hashlength
if {$sha1string == {}
|| ([info exists currentid] && $sha1string == $currentid)} return
@@ -8889,7 +8904,7 @@ proc gotocommit {} {
set id $headids($sha1string)
} else {
set id [string tolower $sha1string]
- if {[regexp {^[0-9a-f]{4,39}$} $id]} {
+ if {[regexp {^[0-9a-f]{4,63}$} $id]} {
set matches [longid $id]
if {$matches ne {}} {
if {[llength $matches] > 1} {
@@ -9378,6 +9393,7 @@ proc doseldiff {oldid newid} {
proc mkpatch {} {
global rowmenuid currentid commitinfo patchtop patchnum NS
+ global hashlength
if {![info exists currentid]} return
set oldid $currentid
@@ -9392,7 +9408,7 @@ proc mkpatch {} {
${NS}::label $top.title -text [mc "Generate patch"]
grid $top.title - -pady 10
${NS}::label $top.from -text [mc "From:"]
- ${NS}::entry $top.fromsha1 -width 40
+ ${NS}::entry $top.fromsha1 -width $hashlength
$top.fromsha1 insert 0 $oldid
$top.fromsha1 conf -state readonly
grid $top.from $top.fromsha1 -sticky w
@@ -9401,7 +9417,7 @@ proc mkpatch {} {
$top.fromhead conf -state readonly
grid x $top.fromhead -sticky w
${NS}::label $top.to -text [mc "To:"]
- ${NS}::entry $top.tosha1 -width 40
+ ${NS}::entry $top.tosha1 -width $hashlength
$top.tosha1 insert 0 $newid
$top.tosha1 conf -state readonly
grid $top.to $top.tosha1 -sticky w
@@ -9470,6 +9486,7 @@ proc mkpatchcan {} {
proc mktag {} {
global rowmenuid mktagtop commitinfo NS
+ global hashlength
set top .maketag
set mktagtop $top
@@ -9479,7 +9496,7 @@ proc mktag {} {
${NS}::label $top.title -text [mc "Create tag"]
grid $top.title - -pady 10
${NS}::label $top.id -text [mc "ID:"]
- ${NS}::entry $top.sha1 -width 40
+ ${NS}::entry $top.sha1 -width $hashlength
$top.sha1 insert 0 $rowmenuid
$top.sha1 conf -state readonly
grid $top.id $top.sha1 -sticky w
@@ -9587,10 +9604,11 @@ proc mktaggo {} {
proc copyreference {} {
global rowmenuid autosellen
+ global hashlength
set format "%h (\"%s\", %ad)"
set cmd [list git show -s --pretty=format:$format --date=short]
- if {$autosellen < 40} {
+ if {$autosellen < $hashlength} {
lappend cmd --abbrev=$autosellen
}
set reference [eval exec $cmd $rowmenuid]
@@ -9601,6 +9619,7 @@ proc copyreference {} {
proc writecommit {} {
global rowmenuid wrcomtop commitinfo wrcomcmd NS
+ global hashlength
set top .writecommit
set wrcomtop $top
@@ -9610,7 +9629,7 @@ proc writecommit {} {
${NS}::label $top.title -text [mc "Write commit to file"]
grid $top.title - -pady 10
${NS}::label $top.id -text [mc "ID:"]
- ${NS}::entry $top.sha1 -width 40
+ ${NS}::entry $top.sha1 -width $hashlength
$top.sha1 insert 0 $rowmenuid
$top.sha1 conf -state readonly
grid $top.id $top.sha1 -sticky w
@@ -9690,6 +9709,7 @@ proc mvbranch {} {
proc branchdia {top valvar uivar} {
global NS commitinfo
+ global hashlength
upvar $valvar val $uivar ui
catch {destroy $top}
@@ -9698,7 +9718,7 @@ proc branchdia {top valvar uivar} {
${NS}::label $top.title -text $ui(title)
grid $top.title - -pady 10
${NS}::label $top.id -text [mc "ID:"]
- ${NS}::entry $top.sha1 -width 40
+ ${NS}::entry $top.sha1 -width $hashlength
$top.sha1 insert 0 $val(id)
$top.sha1 conf -state readonly
grid $top.id $top.sha1 -sticky w
@@ -9708,7 +9728,7 @@ proc branchdia {top valvar uivar} {
grid x $top.head -sticky ew
grid columnconfigure $top 1 -weight 1
${NS}::label $top.nlab -text [mc "Name:"]
- ${NS}::entry $top.name -width 40
+ ${NS}::entry $top.name -width $hashlength
$top.name insert 0 $val(name)
grid $top.nlab $top.name -sticky w
${NS}::frame $top.buts
@@ -11697,6 +11717,7 @@ proc prefspage_general {notebook} {
global tabstop wrapcomment wrapdefault limitdiffs
global autocopy autoselect autosellen extdifftool perfile_attrs
global hideremotes want_ttk have_ttk maxrefs web_browser
+ global hashlength
set page [create_prefs_page $notebook.general]
@@ -11725,7 +11746,8 @@ proc prefspage_general {notebook} {
-variable autoselect
grid x $page.autoselect -sticky w
}
- spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
+
+ spinbox $page.autosellen -from 1 -to $hashlength -width 4 -textvariable autosellen
${NS}::label $page.autosellenl -text [mc "Length of commit ID to copy"]
grid x $page.autosellenl $page.autosellen -sticky w
@@ -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]
@@ -12545,7 +12578,7 @@ set limitdiffs 1
set datetimeformat "%Y-%m-%d %H:%M:%S"
set autocopy 0
set autoselect 1
-set autosellen 40
+set autosellen $hashlength
set perfile_attrs 0
set want_ttk 1
--
2.49.0

View File

@@ -0,0 +1,178 @@
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] git-gui: Add support of SHA256 repo
Date: Tue, 17 Jun 2025 08:03:59 +0200
Message-ID: <20250617060406.10159-1-tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
git-gui/git-gui.sh | 13 ++++++++++++-
git-gui/lib/blame.tcl | 12 ++++++++----
git-gui/lib/choose_repository.tcl | 8 ++++++--
git-gui/lib/remote_branch_delete.tcl | 4 +++-
4 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 28572c889c0e..206981190535 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1275,6 +1275,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]
+if {$hashalgorithm eq "sha1"} {
+ set hashlength 40
+} elseif {$hashalgorithm eq "sha256"} {
+ set hashlength 64
+} else {
+ puts stderr "Unknown hash algorithm: $hashalgorithm"
+ exit 1
+}
+
# 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
@@ -1822,7 +1833,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
diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl
index 8441e109be32..1f0b8ea28504 100644
--- a/git-gui/lib/blame.tcl
+++ b/git-gui/lib/blame.tcl
@@ -426,6 +426,7 @@ method _kill {} {
method _load {jump} {
variable group_colors
+ global hashlength
_hide_tooltip $this
@@ -436,7 +437,7 @@ method _load {jump} {
$i conf -state normal
$i delete 0.0 end
foreach g [$i tag names] {
- if {[regexp {^g[0-9a-f]{40}$} $g]} {
+ if {[regexp [string map "@@ $hashlength" {^g[0-9a-f]{@@}$}] $g]} {
$i tag delete $g
}
}
@@ -500,6 +501,8 @@ method _load {jump} {
}
method _history_menu {} {
+ global hashlength
+
set m $w.backmenu
if {[winfo exists $m]} {
$m delete 0 end
@@ -513,7 +516,7 @@ method _history_menu {} {
set c [lindex $e 0]
set f [lindex $e 1]
- if {[regexp {^[0-9a-f]{40}$} $c]} {
+ if {[regexp [string map "@@ $hashlength" {^[0-9a-f]{@@}$}] $c]} {
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 cur_s} {
method _read_blame {fd cur_w cur_d} {
upvar #0 $cur_d line_data
variable group_colors
+ global hashlength
if {$fd ne $current_fd} {
catch {close $fd}
@@ -635,7 +639,7 @@ method _read_blame {fd cur_w cur_d} {
$cur_w conf -state normal
while {[gets $fd line] >= 0} {
- if {[regexp {^([a-z0-9]{40}) (\d+) (\d+) (\d+)$} $line line \
+ if {[regexp [string map "@@ $hashlength" {^([a-z0-9]{@@}) (\d+) (\d+) (\d+)$}] $line line \
cmit original_line final_line line_count]} {
set r_commit $cmit
set r_orig_line $original_line
@@ -648,7 +652,7 @@ method _read_blame {fd cur_w cur_d} {
set oln $r_orig_line
set cmit $r_commit
- if {[regexp {^0{40}$} $cmit]} {
+ if {[regexp [string map "@@ $hashlength" {^0{@@}$}] $cmit]} {
set commit_abbr work
set commit_type curr_commit
} elseif {$cmit eq $commit} {
diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl
index d23abedcb36f..6078b1c7e2c4 100644
--- a/git-gui/lib/choose_repository.tcl
+++ b/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} {
if {[file exists [gitdir FETCH_HEAD]]} {
set fd [open [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]} {
break
}
}
@@ -965,6 +967,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
@@ -986,7 +990,7 @@ 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]
if {$fd_ph ne {}} {
global pch_error
diff --git a/git-gui/lib/remote_branch_delete.tcl b/git-gui/lib/remote_branch_delete.tcl
index 5ba9fcadd17f..8ea672479306 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} {
}
method _read {cache fd} {
+ global hashlength
+
if {$fd ne $active_ls} {
catch {close $fd}
return
@@ -330,7 +332,7 @@ method _read {cache fd} {
while {[gets $fd line] >= 0} {
if {[string match {*^{}} $line]} continue
- if {[regexp {^([0-9a-f]{40}) (.*)$} $line _junk obj ref]} {
+ if {[regexp [string map "@@ $hashlength" {^([0-9a-f]{@@}) (.*)$}] $line _junk obj ref]} {
if {[regsub ^refs/heads/ $ref {} abr]} {
lappend head_list $abr
lappend head_cache($cache) $abr
--
2.49.0

View File

@@ -0,0 +1,134 @@
From 0c251d64abf2eb7b275554b3fc6784e87f07cfbe Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 19 Mar 2025 11:18:21 +0100
Subject: [PATCH 2/2] gitk: Add auto-select length preference for SHA256
This implements the missing preference setup of the auto select length
for SHA256. The variable set via the preference menu is switched
depending on the hash algorithm.
The default auto-select length is set to 64 for SHA256, and
saved/restored as "autosellensha256" in the config.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
gitk-git/gitk | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1e85cfef2ee3..b364d9e7dc93 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7488,6 +7488,16 @@ proc make_idmark {id} {
$canv raise $t
}
+proc get_autosellen {} {
+ global hashalgorithm autosellen autosellensha256
+
+ if {$hashalgorithm == "SHA256"} {
+ return $autosellensha256
+ } else {
+ return $autosellen
+ }
+}
+
proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
global canv ctext commitinfo selectedline
global canvy0 linespc parents children curview
@@ -7496,7 +7506,7 @@ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
global mergemax numcommits pending_select
global cmitmode showneartags allcommits
global targetrow targetid lastscrollrows
- global autocopy autoselect autosellen jump_to_here
+ global autocopy autoselect jump_to_here
global vinlinediff
unset -nocomplain pending_select
@@ -7563,11 +7573,11 @@ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
$sha1entry delete 0 end
$sha1entry insert 0 $id
if {$autoselect && [haveselectionclipboard]} {
- $sha1entry selection range 0 $autosellen
+ $sha1entry selection range 0 [get_autosellen]
}
if {$autocopy} {
clipboard clear
- clipboard append [string range $id 0 [expr $autosellen - 1]]
+ clipboard append [string range $id 0 [expr [get_autosellen] - 1]]
}
rhighlight_sel $id
@@ -9629,13 +9639,14 @@ proc mktaggo {} {
}
proc copyreference {} {
- global rowmenuid autosellen
+ global rowmenuid
global hashlength
set format "%h (\"%s\", %ad)"
set cmd [list git show -s --pretty=format:$format --date=short]
- if {$autosellen < $hashlength} {
- lappend cmd --abbrev=$autosellen
+ set alen [get_autosellen]
+ if {$alen < $hashlength} {
+ lappend cmd --abbrev=$alen
}
set reference [eval exec $cmd $rowmenuid]
@@ -11741,8 +11752,9 @@ proc create_prefs_page {w} {
proc prefspage_general {notebook} {
global NS maxwidth maxgraphpct showneartags showlocalchanges
global tabstop wrapcomment wrapdefault limitdiffs
- global autocopy autoselect autosellen extdifftool perfile_attrs
+ global autocopy autoselect extdifftool perfile_attrs
global hideremotes want_ttk have_ttk maxrefs web_browser
+ global hashalgorithm hashlength
set page [create_prefs_page $notebook.general]
@@ -11771,7 +11783,13 @@ proc prefspage_general {notebook} {
-variable autoselect
grid x $page.autoselect -sticky w
}
- spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
+
+ if {$hashalgorithm == "SHA256"} {
+ set autolenvar "autosellensha256"
+ } else {
+ set autolenvar "autosellen"
+ }
+ spinbox $page.autosellen -from 1 -to $hashlength -width 4 -textvariable $autolenvar
${NS}::label $page.autosellenl -text [mc "Length of commit ID to copy"]
grid x $page.autosellenl $page.autosellen -sticky w
@@ -11908,7 +11926,7 @@ proc doprefs {} {
global maxwidth maxgraphpct use_ttk NS
global oldprefs prefstop showneartags showlocalchanges
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
- global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
+ global tabstop limitdiffs autoselect extdifftool perfile_attrs
global hideremotes want_ttk have_ttk wrapcomment wrapdefault
set top .gitkprefs
@@ -12606,6 +12624,7 @@ set datetimeformat "%Y-%m-%d %H:%M:%S"
set autocopy 0
set autoselect 1
set autosellen 40
+set autosellensha256 64
set perfile_attrs 0
set want_ttk 1
@@ -12702,7 +12721,7 @@ config_check_tmp_exists 50
set config_variables {
mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
cmitmode wrapcomment wrapdefault autocopy autoselect autosellen
- showneartags maxrefs visiblerefs
+ autosellensha256 showneartags maxrefs visiblerefs
hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
--
2.49.0

20
CVE-2024-24577.patch Normal file
View File

@@ -0,0 +1,20 @@
Index: b/read-cache.c
===================================================================
--- a/read-cache.c
+++ b/read-cache.c
@@ -1158,10 +1158,13 @@ static int has_dir_name(struct index_sta
size_t len;
for (;;) {
- if (*--slash == '/')
- break;
+ slash--;
+
if (slash <= ce->name)
return retval;
+
+ if (*slash == '/')
+ break;
}
len = slash - name;

15
apache2-gitweb.conf Normal file
View File

@@ -0,0 +1,15 @@
Alias /git "/usr/share/gitweb/"
<Directory "/usr/share/gitweb">
Options ExecCGI
AllowOverride None
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
<IfModule mod_access_compat.c>
Order allow,deny
Allow from all
</IfModule>
<IfModule !mod_access_compat.c>
Require all granted
</IfModule>
</Directory>

View File

@@ -0,0 +1,25 @@
---
contrib/completion/git-completion.bash | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: git-2.43.1/contrib/completion/git-completion.bash
===================================================================
--- git-2.43.1.orig/contrib/completion/git-completion.bash
+++ git-2.43.1/contrib/completion/git-completion.bash
@@ -67,10 +67,12 @@
# case insensitively, even on systems with case sensitive file systems
# (e.g., completing tag name "FOO" on "git checkout f<TAB>").
-case "$COMP_WORDBREAKS" in
-*:*) : great ;;
-*) COMP_WORDBREAKS="$COMP_WORDBREAKS:"
-esac
+# SUSE-specific: We trust the system is consistent and do not let individual
+# scripts play ping-pong with the global $COMP_WORDBREAKS value.
+#case "$COMP_WORDBREAKS" in
+#*:*) : great ;;
+#*) COMP_WORDBREAKS="$COMP_WORDBREAKS:"
+#esac
# Discovers the path to the git repository taking any '--git-dir=<path>' and
# '-C <path>' options into account and stores it in the $__git_repo_path

BIN
git-2.45.2.tar.sign Normal file

Binary file not shown.

3
git-2.45.2.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:51bfe87eb1c02fed1484051875365eeab229831d30d0cec5d89a14f9e40e9adb
size 7487680

BIN
git-2.46.0.tar.sign Normal file

Binary file not shown.

BIN
git-2.46.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
git-2.46.1.tar.sign Normal file

Binary file not shown.

BIN
git-2.46.1.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
git-2.47.0.tar.sign Normal file

Binary file not shown.

3
git-2.47.0.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ce114da88704271b43e027c51e04d9399f8c88e9ef7542dae7aebae7d87bc4e
size 7652728

BIN
git-2.47.1.tar.sign Normal file

Binary file not shown.

3
git-2.47.1.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3d8f9bb23ae392374e91cd9d395970dabc5b9c5ee72f39884613cd84a6ed310
size 7654244

BIN
git-2.48.0.tar.sign Normal file

Binary file not shown.

3
git-2.48.0.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4803b809c42696b3b8cce6b0ba6de26febe1197f853daf930a484db93c1ad0d5
size 7723336

BIN
git-2.48.1.tar.sign Normal file

Binary file not shown.

3
git-2.48.1.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c5d545f5dc1eb51e95d2c50d98fdf88b1a36ba1fa30e9ae5d5385c6024f82ad
size 7723580

BIN
git-2.49.0.tar.sign Normal file

Binary file not shown.

3
git-2.49.0.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:618190cf590b7e9f6c11f91f23b1d267cd98c3ab33b850416d8758f8b5a85628
size 7771796

17
git-asciidoc.patch Normal file
View File

@@ -0,0 +1,17 @@
---
Documentation/asciidoc.conf.in | 2 ++
1 file changed, 2 insertions(+)
Index: git-2.48.0/Documentation/asciidoc.conf.in
===================================================================
--- git-2.48.0.orig/Documentation/asciidoc.conf.in
+++ git-2.48.0/Documentation/asciidoc.conf.in
@@ -24,6 +24,8 @@ litdd=&#45;&#45;
manmanual=Git Manual
mansource=Git @GIT_VERSION@
revdate=@GIT_DATE@
+# drops the "last-updated" footer, with asciidoc-8.6.9+
+footer-style=none
ifdef::doctype-book[]
[titles]

2
git-daemon.conf Normal file
View File

@@ -0,0 +1,2 @@
# Type Name ID GECOS [HOME]
u git-daemon - "git daemon" /var/lib/empty -

26
git-daemon.service Normal file
View File

@@ -0,0 +1,26 @@
[Unit]
Description=Git Daemon
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
EnvironmentFile=-/etc/sysconfig/git-daemon
ExecStart=/bin/bash -c 'exec git daemon --reuseaddr --base-path=$${GIT_DAEMON_BASE_PATH:-/srv/git/} --user=$${GIT_DAEMON_USER:-git-daemon} --group=$${GIT_DAEMON_GROUP:-git-daemon} $GIT_DAEMON_ARGS'
Restart=always
RestartSec=500ms
SyslogIdentifier=git-daemon
[Install]
WantedBy=multi-user.target

11
git-gui.desktop Normal file
View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Name=Git Gui
GenericName=Version Control GUI
Comment=Git GUI
Exec=git gui
Icon=git-gui
StartupNotify=false
Terminal=false
Type=Application
Categories=Development;RevisionControl;
X-KDE-SubstituteUID=false

BIN
git-gui.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,42 @@
From: Jakub Narebski <jnareb@...il.com>
Subject: [PATCH] gitweb: Enable $prevent_xss by default
This fixes issue CVE-2011-2186 originally reported in
https://launchpad.net/bugs/777804
Reported-by: dave b <db.pub.mail@...il.com>
Signed-off-by: Jakub Narebski <jnareb@...il.com>
---
git-instaweb.sh | 4 ++++
gitweb/README | 5 +++--
gitweb/gitweb.perl | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
Index: git-2.43.1/git-instaweb.sh
===================================================================
--- git-2.43.1.orig/git-instaweb.sh
+++ git-2.43.1/git-instaweb.sh
@@ -721,6 +721,10 @@ our \$projectroot = "$(dirname "$fqgitdi
our \$git_temp = "$fqgitdir/gitweb/tmp";
our \$projects_list = \$projectroot;
+# we can trust our own repository, so disable XSS prevention
+# to enable some extra features
+our \$prevent_xss = 0;
+
\$feature{'remote_heads'}{'default'} = [1];
EOF
}
Index: git-2.43.1/gitweb/gitweb.perl
===================================================================
--- git-2.43.1.orig/gitweb/gitweb.perl
+++ git-2.43.1/gitweb/gitweb.perl
@@ -194,7 +194,7 @@ our @diff_opts = ('-M'); # taken from gi
# Disables features that would allow repository owners to inject script into
# the gitweb domain.
-our $prevent_xss = 0;
+our $prevent_xss = 1;
# Path to the highlight executable to use (must be the one from
# http://andre-simon.de/zip/download.php due to assumptions about parameters and output).

11
git-prompt Normal file
View File

@@ -0,0 +1,11 @@
# In git versions < 1.7.12, this shell library was part of the
# git completion script.
#
# Some users rely on the __git_ps1 function becoming available
# when bash-completion is loaded. Continue to load this library
# at bash-completion startup for now, to ease the transition to a
# world order where the prompt function is requested separately.
#
if [[ -e /usr/share/bash-completion/completions/git-prompt.sh ]]; then
. /usr/share/bash-completion/completions/git-prompt.sh
fi

View File

@@ -0,0 +1,57 @@
---
contrib/completion/git-completion.tcsh | 17 +++++++----------
contrib/completion/git.csh | 4 ++++
contrib/completion/git.tcsh | 4 ++++
3 files changed, 15 insertions(+), 10 deletions(-)
Index: git-2.11.0/contrib/completion/git-completion.tcsh
===================================================================
--- git-2.11.0.orig/contrib/completion/git-completion.tcsh
+++ git-2.11.0/contrib/completion/git-completion.tcsh
@@ -32,14 +32,14 @@ if ( ${__git_tcsh_completion_version[1]}
endif
unset __git_tcsh_completion_version
-set __git_tcsh_completion_original_script = ${HOME}/.git-completion.bash
-set __git_tcsh_completion_script = ${HOME}/.git-completion.tcsh.bash
+set __git_tcsh_completion_original_script = /usr/share/bash-completion/completions/git
+set __git_tcsh_completion_script = $RPM_BUILD_ROOT/usr/share/tcsh/git.complete
-# Check that the user put the script in the right place
-if ( ! -e ${__git_tcsh_completion_original_script} ) then
- echo "git-completion.tcsh: Cannot find: ${__git_tcsh_completion_original_script}. Git completion will not work."
- exit
-endif
+# # Check that the user put the script in the right place
+# if ( ! -e ${__git_tcsh_completion_original_script} ) then
+# echo "git-completion.tcsh: Cannot find: ${__git_tcsh_completion_original_script}. Git completion will not work."
+# exit
+# endif
cat << EOF >! ${__git_tcsh_completion_script}
#!bash
@@ -121,6 +121,3 @@ EOF
# Don't need this variable anymore, so don't pollute the users environment
unset __git_tcsh_completion_original_script
-
-complete git 'p,*,`bash ${__git_tcsh_completion_script} git "${COMMAND_LINE}"`,'
-complete gitk 'p,*,`bash ${__git_tcsh_completion_script} gitk "${COMMAND_LINE}"`,'
Index: git-2.11.0/contrib/completion/git.csh
===================================================================
--- /dev/null
+++ git-2.11.0/contrib/completion/git.csh
@@ -0,0 +1,4 @@
+if (${?prompt}) then
+complete git 'p,*,`bash /usr/share/tcsh/git.complete git "${COMMAND_LINE}"`,'
+complete gitk 'p,*,`bash /usr/share/tcsh/git.complete gitk "${COMMAND_LINE}"`,'
+endif
Index: git-2.11.0/contrib/completion/git.tcsh
===================================================================
--- /dev/null
+++ git-2.11.0/contrib/completion/git.tcsh
@@ -0,0 +1,4 @@
+if (${?prompt}) then
+complete git 'p,*,`bash /usr/share/tcsh/git.complete git "${COMMAND_LINE}"`,'
+complete gitk 'p,*,`bash /usr/share/tcsh/git.complete gitk "${COMMAND_LINE}"`,'
+endif

5743
git.changes Normal file

File diff suppressed because it is too large Load Diff

152
git.keyring Normal file
View File

@@ -0,0 +1,152 @@
pub 4096R/713660A7 2011-10-01
uid [ unknown] Junio C Hamano <gitster@pobox.com>
uid [ unknown] Junio C Hamano <jch@google.com>
uid [ unknown] Junio C Hamano <junio@pobox.com>
sub 4096R/833262C4 2011-10-01
sub 4096R/96AFE6CB 2011-10-03 [expires: 2015-09-21]
sub 4096R/B3F7CAC9 2014-09-20 [expires: 2017-09-19]
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBE6GdewBEADE3szNmKeUAUad22z1tWkLjLzyDcJpF7IzEnLs8bD1y0I6iqH0
169ru5iXKn29wc+YAuxWorb4P5a2i2B/vs32hJy/rXE7dpvsAqlHLSGSDUJXiFzM
Bb9SfJO0EY2r+vqzeQgSUmhp/b4dAXVnMATFM37V83H/mq8REl5Wwb2rxP3pcv6W
F6i51+tPEWIUgo1N74QkR4wdLcPztDO9v7ZIaFKl+2GEGkx6Z+YjECTqQuyushjq
41K3UVmv+AmLhJYKA78HY5KqCkXrz8rCgoi+Ih+ZT2sgjx637yT84Dr/QDh7BkIB
blmpRQ+yoJlVDWI5/bI8rcdrPz+NmxaJ7dKEBg0qTclbwquacpwG1DCCD8NgQrwL
WVLGVdsT2qwek+KkmOs+iNBXY1TgKPAeuv0ZDKKYrCwYpN1K90oXk431g79bKsH5
8Tybg5uW+e2i+H5gnDeyl481HOt8aHOPu9qIB/zIek6lDH69q3nGcf7k3prx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 @@
#
# spec file for package git
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 Andreas Stieger <Andreas.Stieger@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define rb_build_ruby_abis %{rb_default_ruby_abi}
%define rb_build_versions %{rb_default_ruby}
%define gitexecdir %{_libexecdir}/git
%if 0%{?suse_version} < 1500
%define _fwdefdir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
%define SuSEfirewall2 1
%endif
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
# Compat stub for python3_fix_shebang_path
%{?!python3_fix_shebang_path:%define python3_fix_shebang_path(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) \\\
myargs="%{**}" \
for f in ${myargs}; do \
[ -f "$f" ] && sed -i -e "1s@#\\!.*python.*@#\\!$(realpath %__python3)@" $f \
done
}
%bcond_without git_libsecret
%bcond_without docs
%if 0%{?suse_version} >= 1500 && %{with docs}
%bcond_without asciidoctor
%else
%bcond_with asciidoctor
%endif
Name: git
Version: 2.49.0
Release: 0
Summary: Fast, scalable, distributed revision control system
License: GPL-2.0-only
Group: Development/Tools/Version Control
URL: https://git-scm.com/
Source0: https://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.xz
Source1: apache2-gitweb.conf
Source2: sysconfig.git-daemon
Source3: git-daemon.service
Source5: usr.share.git-web.gitweb.cgi
Source6: susefirewall-git-daemon
Source7: https://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.sign
Source8: %{name}.keyring
Source9: %{name}-gui.desktop
Source10: %{name}-gui.png
Source11: git-daemon.conf
Source12: git-prompt
Patch3: completion-wordbreaks.diff
# CVE-2011-2186, bnc#698456
Patch4: git-prevent_xss-default.diff
# cook up tcsh completion to be installable (bnc#853183)
Patch6: git-tcsh-completion-fixes.diff
Patch8: git-asciidoc.patch
Patch10: setup-don-t-fail-if-commondir-reference-is-deleted.patch
# PATCH-FIX-OPENSUSE CVE-2024-24577.patch boo#1219660 antonio.teixeira@suse.com
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
BuildRequires: fdupes
BuildRequires: gpg2
BuildRequires: libcurl-devel
BuildRequires: libexpat-devel
BuildRequires: libopenssl-devel
BuildRequires: pcre2-devel
BuildRequires: perl-Error
BuildRequires: perl-MailTools
BuildRequires: pkgconfig
# for the %%python3_fix_shebang_path macro
BuildRequires: python-rpm-macros
BuildRequires: python3-base
BuildRequires: systemd-rpm-macros
BuildRequires: tcsh
BuildRequires: update-desktop-files
BuildRequires: xz
%if 0%{?suse_version} >= 1600
BuildRequires: pkgconfig(zlib-ng)
%else
BuildRequires: pkgconfig(zlib)
%endif
Requires: git-core = %{version}
Requires: perl-Git = %{version}
Recommends: git-email
Suggests: git-daemon
Suggests: git-gui
Suggests: git-web
Suggests: gitk
%if 0%{?suse_version} >= 1500
BuildRequires: openssh-clients
BuildRequires: sysuser-tools
%endif
%if %{with docs}
BuildRequires: sgml-skel
BuildRequires: xmlto
%if %{with asciidoctor}
BuildRequires: %{rubygem asciidoctor}
BuildRequires: docbook5-xsl-stylesheets
%else
BuildRequires: asciidoc
%endif
%endif
%if %{with git_libsecret}
BuildRequires: libsecret-devel
%endif
%if 0%{?suse_version} > 1320
BuildRequires: libsha1detectcoll-devel
%endif
%description
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations and
full access to internals.
This package itself only provides the README of git but with the
packages it requires, it brings you a complete Git environment
including GTK and email interfaces and tools for importing source code
repositories from other revision control systems such as subversion,
CVS, and GNU arch.
%package core
Summary: Core git tools
Group: Development/Tools/Version Control
Requires: /usr/bin/less
Obsoletes: git-remote-helpers < %{version}
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150300
Recommends: openssh-clients
%else
Recommends: openssh
%endif
%description core
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations and
full access to internals.
These are the core tools with minimal dependencies.
%package -n perl-Git
Summary: perl Bindings for Git
Group: Development/Libraries/Perl
Requires: perl-Error
Provides: git-core:%{perl_vendorlib}/Git
%{perl_requires}
%description -n perl-Git
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations and
full access to internals.
This package provides the Perl interface to the Git version control system.
%package doc
Summary: Documentation for the Git version control system
Group: Documentation/HTML
BuildArch: noarch
%description doc
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations and
full access to internals.
This subpackage contains Git's documentation in text/plain and
text/html formats. (The manpages are in the main package.)
%package svn
Summary: Git tools for importing Subversion repositories
Group: Development/Tools/Version Control
Requires: git-core = %{version}
Requires: perl-Git = %{version}
Requires: perl-Term-ReadKey
Requires: subversion
Requires: subversion-perl
Supplements: (%{name} and subversion)
%description svn
Tools for importing Subversion repositories to the Git version control
system.
%package cvs
Summary: Git tools for importing CVS repositories
Group: Development/Tools/Version Control
Requires: cvs
Requires: cvsps
Requires: git-core = %{version}
Requires: perl-DBD-SQLite
Requires: perl-Git = %{version}
Supplements: (%{name} and cvs)
%description cvs
Tools for importing CVS repositories to the Git version control system.
%if %{with git_libsecret}
%package credential-libsecret
Summary: Git credential backend using libsecret to access keyring
Group: Development/Tools/Version Control
Requires: git-core = %{version}
Obsoletes: git-credential-gnome-keyring < %{version}
%description credential-libsecret
A Git credential backend which uses libsecret API to acces keyrings such as
kwallet or GNOME keyring.
%endif
%package arch
Summary: Git tools for importing Arch repositories
Group: Development/Tools/Version Control
Requires: git-core = %{version}
# Requires: tla
%description arch
Tools for importing GNU Arch repositories to the GIT version control
system.
%package p4
Summary: Git tools for importing Perforce repositories
Group: Development/Tools/Version Control
Requires: git-core = %{version}
%description p4
Tools for importing Perforce repositories to the GIT version control
system.
%package email
Summary: Git tools for sending email
Group: Development/Tools/Version Control
Requires: git-core = %{version}
# For sending mails over secure SMTP:
Requires: perl-Authen-SASL
Requires: perl-Git = %{version}
Requires: perl-MailTools
Requires: perl-Net-SMTP-SSL
%description email
Email interface for the GIT version control system.
%package daemon
Summary: Simple Server for Git Repositories
Group: Development/Tools/Version Control
Requires: bash
Requires: git-core = %{version}
Requires(pre): %fillup_prereq
%if 0%{?suse_version} >= 1500
%{?sysusers_requires}
%{?systemd_requires}
%else
Requires(pre): %{_sbindir}/useradd
Requires(pre): shadow
%endif
%description daemon
A really simple TCP git daemon. In the default configuration it allows
read only access to repositories in /srv/git/ that contain the
'git-daemon-export-ok' file.
%package -n gitk
Summary: Git revision tree visualiser
Group: Development/Tools/Version Control
Requires: git-core = %{version}
Requires: tk >= 8.4
%if 0%{?suse_version} == 1315
Supplements: (git-core and tk)
%else
Supplements: (git-core and tk)
%endif
%description -n gitk
Grapical tool for visualization of revision trees of projects
maintained in the Git version control system. It name gitk indicates
that it's written using the Tk Widget set.
A simple Tk based graphical interface for common Git operations is
found in the package git-gui.
%package gui
Summary: Grapical tool for common git operations
Group: Development/Tools/Version Control
Requires: git-core = %{version}
Requires: tk >= 8.4
%if 0%{?suse_version} == 1315
Supplements: (git-core and tk)
%else
Supplements: (git-core and tk)
%endif
%description gui
A Tcl/Tk based graphical user interface to Git. git-gui focuses on
allowing users to make changes to their repository by making new
commits, amending existing ones, creating branches, performing local
merges, and fetching/pushing to remote repositories.
Unlike gitk, git-gui focuses on commit generation and single file
annotation, and does not show project history. It does however supply
menu actions to start a gitk session from within git-gui.
%package web
Summary: Git Web Interface
Group: Development/Tools/Version Control
Requires: git-core = %{version}
Requires: perl-CGI
Requires: perl-Git = %{version}
%if 0%{?suse_version} == 1315
Supplements: (git-core and apache2)
%else
Supplements: (git-core and apache2)
%endif
%description web
CGI script that allows browsing git repositories via web interface.
The apache2 configuration contained in this package installs a virtual
directory /git/ that calls the cgi script.
%prep
%autosetup -p1
%build
# update shebang to use python3
sed -e '1{s,.*,#!%{_bindir}/python3,}' git-p4.py
cat > .make <<'EOF'
#!/bin/bash
%make_build CFLAGS="%{optflags}" \
GITWEB_CONFIG="%{_sysconfdir}/gitweb.conf" \
GITWEB_PROJECTROOT="/srv/git" \
WITH_OWN_SUBPROCESS_PY=YesPlease \
DESTDIR=%{buildroot} \
NO_CROSS_DIRECTORY_HARDLINKS=1 \
NO_INSTALL_HARDLINKS=1 \
%if 0%{?suse_version} > 1320
DC_SHA1_EXTERNAL=YesPlease \
%endif
%if %{with asciidoctor}
USE_ASCIIDOCTOR=YesPlease \
%endif
PYTHON_PATH=%{_bindir}/python3 \
USE_LIBPCRE2=YesPlease \
NO_PERL_CPAN_FALLBACKS=1 \
V=1 \
prefix=%{_prefix} mandir=%{_mandir} \
gitexecdir=%{gitexecdir} \
htmldir=%{_docdir}/git \
perllibdir=%{perl_vendorlib} \
"$@"
EOF
#
chmod 755 .make
./.make all %{?_smp_mflags}
%if %{with docs}
./.make doc %{?_smp_mflags}
%endif
%if %{with git_libsecret}
./.make -C contrib/credential/libsecret
%endif
./.make -C contrib/subtree/
%if 0%{?suse_version} >= 1500
%sysusers_generate_pre %{SOURCE11} git-daemon git-daemon.conf
%endif
%install
./.make install %{!?_without_docs: install-doc}
### git-web
cp gitweb/INSTALL INSTALL.gitweb
cp gitweb/README README.gitweb
install -d %{buildroot}%{_datadir}/git-web
install -d %{buildroot}%{_sysconfdir}/apache2/conf.d
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/apache2/conf.d/gitweb.conf
### git-daemon
install -d -m 755 %{buildroot}%{_unitdir}
install -m 644 %{SOURCE3} %{buildroot}/%{_unitdir}/git-daemon.service
install -d -m 755 %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcgit-daemon
install -d -m 755 %{buildroot}%{_fillupdir}
install -m 644 %{SOURCE2} %{buildroot}%{_fillupdir}/sysconfig.git-daemon
install -d -m 755 %{buildroot}/srv/git
%if 0%{?SuSEfirewall2}
mkdir -p %{buildroot}/%{_fwdefdir}
install -m 644 %{SOURCE6} %{buildroot}/%{_fwdefdir}/git-daemon
%endif
###
./.make -C contrib/subtree install
%{!?_without_docs: ./.make -C contrib/subtree install-doc}
(find %{buildroot}%{_bindir} -type f -o -type l | grep -vE "archimport|p4|svn|cvs|email|gitk|git-daemon|gui|web" | sed -e s@^%{buildroot}@@) > bin-man-doc-files
(find %{buildroot}%{gitexecdir} ! -type d | grep -vE "archimport|p4|svn|cvs|email|gitk|git-daemon|gui|web" | sed -e s@^%{buildroot}@@) >> bin-man-doc-files
(find %{buildroot}%{_mandir} -type f | grep -vE "archimport|p4|svn|git-cvs|email|gitk|git-daemon|gui|web" | sed -e s@^%{buildroot}@@ -e 's/$/*/' ) >> bin-man-doc-files
# Don't pick up dependencies from sample files
find %{buildroot}/%{_datadir}/git-core/templates -type f -name "*.sample" -exec chmod a-x "{}" "+"
%perl_process_packlist
%if %{with docs}
find %{buildroot}/%{_mandir} -type f -exec chmod 644 "{}" "+"
%endif
install -m 644 -D contrib/completion/git-completion.bash %{buildroot}%{_datadir}/bash-completion/completions/git
install -m 644 -D contrib/completion/git-prompt.sh %{buildroot}%{_datadir}/bash-completion/completions/git-prompt.sh
mkdir -p %{buildroot}/%{_sysconfdir}/bash_completion.d/
install -m 644 %{SOURCE12} %{buildroot}/%{_sysconfdir}/bash_completion.d/git-prompt
# contrib/credential
%if %{with git_libsecret}
install -m 755 -D contrib/credential/libsecret/git-credential-libsecret %{buildroot}/%{gitexecdir}/git-credential-libsecret
%endif
# contrib/workdir
install -m 755 -D contrib/workdir/git-new-workdir %{buildroot}/%{_bindir}
# process tcsh completion
(cd contrib/completion
mkdir -p %{buildroot}%{_datadir}/tcsh
tcsh ./git-completion.tcsh
install -m 644 -D git.csh %{buildroot}%{_sysconfdir}/profile.d/git.csh
)
# zsh completion
install -m 644 -D contrib/completion/git-completion.zsh %{buildroot}%{_datadir}/zsh/site-functions/_git
#
# apparmor profile for git-web
#
install -d -m 755 %{buildroot}%{_sysconfdir}/apparmor.d
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/apparmor.d
#
# create predictable symlinks to make apparmor profile work
for i in git git-upload-archive git-receive-pack; do
rm %{buildroot}%{_bindir}/$i
ln -s %{gitexecdir}/git %{buildroot}%{_bindir}/$i
done
if ! test -f %{buildroot}%{gitexecdir}/git-add; then
echo "git-add is not a regular file, apparmor profile won't work!" >&2
exit 1
fi
mkdir -p "%{buildroot}/%{_docdir}/git" "%{buildroot}/%{_docdir}/git/howto" "%{buildroot}/%{_docdir}/git/technical"
cp -a README.md Documentation/*.adoc "%{buildroot}/%{_docdir}/git/"
cp -a Documentation/howto/*.adoc "%{buildroot}/%{_docdir}/git/howto/"
cp -a Documentation/technical/*.adoc "%{buildroot}/%{_docdir}/git/technical/"
%{!?_without_docs: cp -a Documentation/*.html "%{buildroot}/%{_docdir}/git/"}
%{!?_without_docs: cp -a Documentation/howto/*.html "%{buildroot}/%{_docdir}/git/howto/"}
%{!?_without_docs: cp -a Documentation/technical/*.html "%{buildroot}/%{_docdir}/git/technical/"}
install -d -m 755 %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE9} %{buildroot}%{_datadir}/applications
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
install -m 644 %{SOURCE10} %{buildroot}%{_datadir}/pixmaps
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/%{name}-gui.desktop
%if 0%{?suse_version} >= 1500
mkdir -p %{buildroot}%{_sysusersdir}
install -m 0644 %{SOURCE11} %{buildroot}%{_sysusersdir}/
%endif
%find_lang %{name}
cat %{name}.lang >>bin-man-doc-files
%if %{defined python3_fix_shebang_path}
# fix shebang for git-p4 (and possibly others)
%python3_fix_shebang_path %{buildroot}%{gitexecdir}/*
%endif
# use symlinks instead of hardlinks in sub-commands
%fdupes -s %{buildroot}
%check
# https://public-inbox.org/git/f1a5f758-d81f-5985-9b5d-2f0dbfaac071@opensuse.org/
%ifnarch s390x
./.make %{?_smp_mflags} test
%endif
%if 0%{?suse_version} >= 1500
%pre daemon -f git-daemon.pre
%else
%pre daemon
if ! %{_bindir}/getent passwd git-daemon >/dev/null; then
%{_sbindir}/useradd -r -d %{_localstatedir}/lib/empty -s /bin/false -c "git daemon" -g nogroup git-daemon
fi
%endif
%service_add_pre git-daemon.service
%post daemon
%{fillup_only -n git-daemon}
%service_add_post git-daemon.service
%preun daemon
%service_del_preun git-daemon.service
%postun daemon
%service_del_postun git-daemon.service
%files
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/README.md
%files doc
%{_docdir}/%{name}/
%exclude %{_docdir}/%{name}/README.md
%files svn
%{gitexecdir}/*svn*
%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
%files cvs
%{_bindir}/git-cvs*
%{gitexecdir}/*cvs*
%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
%if %{with git_libsecret}
%files credential-libsecret
%{gitexecdir}/git-credential-libsecret
%endif
%files arch
%{gitexecdir}/git-archimport
%{!?_without_docs: %{_mandir}/man1/git-archimport.1*}
%files p4
%{gitexecdir}/git-p4
%{gitexecdir}/mergetools/p4merge
%{!?_without_docs: %{_mandir}/man1/git-p4.1*}
%files email
%{gitexecdir}/*email*
%{!?_without_docs: %{_mandir}/man1/*email*.1*}
%files daemon
%{gitexecdir}/git-daemon
%{_unitdir}/git-daemon.service
%{_sbindir}/rcgit-daemon
%dir /srv/git
%{_fillupdir}/sysconfig.git-daemon
%{!?_without_docs: %{_mandir}/man1/git-daemon.1*}
%if 0%{?SuSEfirewall2}
%config %{_fwdefdir}/*
%endif
%if 0%{?suse_version} >= 1500
%{_sysusersdir}/git-daemon.conf
%endif
%files -n gitk
%{_bindir}/gitk
%{_datadir}/gitk
%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
%files gui
%{gitexecdir}/git-gui*
%{_datadir}/git-gui
%{!?_without_docs: %{_mandir}/man1/*gui*.1*}
%{_datadir}/applications/%{name}-gui.desktop
%{_datadir}/pixmaps/%{name}-gui.png
%files web
%doc README.gitweb INSTALL.gitweb
%dir %{_sysconfdir}/apache2
%dir %{_sysconfdir}/apache2/conf.d/
%config(noreplace) %{_sysconfdir}/apache2/conf.d/gitweb.conf
%{_datadir}/gitweb
%dir %{_sysconfdir}/apparmor.d
%config(noreplace) %{_sysconfdir}/apparmor.d/usr.share.git-web.gitweb.cgi
%{gitexecdir}//git-instaweb
%{gitexecdir}//git-web--browse
%{_mandir}/man1/*web*1%{?ext_man}
%{_mandir}/man5/*web*5%{?ext_man}
%files core -f bin-man-doc-files
%license COPYING
%{_datadir}/git-core/
%dir %{gitexecdir}
%dir %{gitexecdir}/mergetools
%{gitexecdir}/mergetools/guiffy
%{_bindir}/git-new-workdir
%{_datadir}/bash-completion/completions/*
%{_sysconfdir}/bash_completion.d/git-prompt
%{_datadir}/tcsh
%{_datadir}/zsh/site-functions/_git
%{_sysconfdir}/profile.d/*.csh
%files -n perl-Git
%license COPYING
%attr(-,root,root) %{perl_vendorlib}/Git
%attr(-,root,root) %{perl_vendorlib}/Git.pm
%changelog

View File

@@ -0,0 +1,67 @@
From 37df7fd81c3dee990bd7723f18c94713a0d842b6 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Fri, 15 Feb 2019 18:46:20 +0100
Subject: [PATCH] setup: don't fail if commondir reference is deleted.
Apparently it can happen that stat() claims there is a commondir file but when
trying to open the file it is missing.
Another even rarer issue is that the file might be zero size because another
process initializing a worktree opened the file but has not written is content
yet.
When any of this happnes git aborts failing to perform perfectly valid
command because unrelated worktree is not yet fully initialized.
Rather than testing if the file exists before reading it handle ENOENT
and ENOTDIR.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
v2:
- do not test file existence first, just read it and handle ENOENT.
- handle zero size file correctly
v3:
- handle ENOTDIR as well
- add more details to commit message
---
setup.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
Index: git-2.43.1/setup.c
===================================================================
--- git-2.43.1.orig/setup.c
+++ git-2.43.1/setup.c
@@ -316,12 +316,20 @@ int get_common_dir_noenv(struct strbuf *
{
struct strbuf data = STRBUF_INIT;
struct strbuf path = STRBUF_INIT;
- int ret = 0;
+ int ret;
strbuf_addf(&path, "%s/commondir", gitdir);
- if (file_exists(path.buf)) {
- if (strbuf_read_file(&data, path.buf, 0) <= 0)
+ ret = strbuf_read_file(&data, path.buf, 0);
+ if (ret <= 0) {
+ /*
+ * if file is missing or zero size (just being written)
+ * assume default, bail otherwise
+ */
+ if (ret && errno != ENOENT && errno != ENOTDIR)
die_errno(_("failed to read %s"), path.buf);
+ strbuf_addstr(sb, gitdir);
+ ret = 0;
+ } else {
while (data.len && (data.buf[data.len - 1] == '\n' ||
data.buf[data.len - 1] == '\r'))
data.len--;
@@ -332,8 +340,6 @@ int get_common_dir_noenv(struct strbuf *
strbuf_addbuf(&path, &data);
strbuf_add_real_path(sb, path.buf);
ret = 1;
- } else {
- strbuf_addstr(sb, gitdir);
}
strbuf_release(&data);

4
susefirewall-git-daemon Normal file
View File

@@ -0,0 +1,4 @@
## Name: git-daemon
## Description: Open ports for git-daemon
TCP="git"

34
sysconfig.git-daemon Normal file
View File

@@ -0,0 +1,34 @@
## Path: Network/git-daemon
## Description: git daemon configuration
## ServiceRestart: git-daemon
## Type: string
## Default:
#
# base path for exported directories
#
# defaults to "/srv/git" if not set
#
GIT_DAEMON_BASE_PATH=""
## Type: string
## Default:
#
# additional arguments for git-daemon. See manual page
GIT_DAEMON_ARGS=""
## Type: string
## Default:
#
# defaults to "git-daemon" if not set
#
# User to run git-daemon as.
GIT_DAEMON_USER=""
## Type: string
## Default:
#
# defaults to "git-daemon" if not set
#
# Group to run git-daemon as.
GIT_DAEMON_GROUP=""

View File

@@ -0,0 +1,36 @@
#include <tunables/global>
profile gitweb.cgi /usr/share/gitweb/gitweb.cgi {
#include <abstractions/base>
#include <abstractions/bash>
#include <abstractions/nameservice>
#include <abstractions/perl>
#include <abstractions/private-files-strict>
/etc/gitconfig r,
/{usr/,}bin/bash rix,
/{usr/,}bin/tar rix,
/usr/bin/gzip rix,
/usr/bin/bzip2 rix,
/usr/bin/zip rix,
/dev/tty rw,
/etc/gitweb.conf r,
/etc/gitweb-common.conf r,
/etc/mime.types r,
/proc/loadavg r,
/proc/meminfo r,
/proc/sys/kernel/ngroups_max r,
/srv/git/ r,
/srv/git/** r,
/usr/bin/perl ix,
/usr/libexec/git/git rix,
/usr/bin/git-receive-pack rix,
/usr/share/gitweb/* r,
/usr/share/gitweb/static/* r,
owner /**/ r,
owner /**/.git/** r,
owner @{HOME}/.gitconfig r,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/usr.share.git-web.gitweb.cgi>
}