Skip to content

Commit 61f57cb

Browse files
lilyballpaulusmack
authored andcommitted
gitk: Allow unbalanced quotes/braces in commit headers
When parsing commits, gitk treats the headers of the commit as tcl lists. This causes errors if the header contains an unbalanced quote or open brace. Splitting the line on spaces allows us to treat it as a set of words instead of as a tcl list, which prevents errors. Signed-off-by: Kevin Ballard <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 48027a9 commit 61f57cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,13 +1601,14 @@ proc parsecommit {id contents listed} {
16011601
set header [string range $contents 0 [expr {$hdrend - 1}]]
16021602
set comment [string range $contents [expr {$hdrend + 2}] end]
16031603
foreach line [split $header "\n"] {
1604+
set line [split $line " "]
16041605
set tag [lindex $line 0]
16051606
if {$tag == "author"} {
16061607
set audate [lindex $line end-1]
1607-
set auname [lrange $line 1 end-2]
1608+
set auname [join [lrange $line 1 end-2] " "]
16081609
} elseif {$tag == "committer"} {
16091610
set comdate [lindex $line end-1]
1610-
set comname [lrange $line 1 end-2]
1611+
set comname [join [lrange $line 1 end-2] " "]
16111612
}
16121613
}
16131614
set headline {}

0 commit comments

Comments
 (0)