All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitk: Allow unbalanced quotes/braces in commit headers
@ 2008-12-18  9:26 Kevin Ballard
  0 siblings, 0 replies; only message in thread
From: Kevin Ballard @ 2008-12-18  9:26 UTC (permalink / raw)
  To: Paul Mackerras, demerphq, git; +Cc: Kevin Ballard

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 <kevin@sb.org>
---
 gitk |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index a5e24e4..83b45cd 100755
--- a/gitk
+++ b/gitk
@@ -1601,13 +1601,14 @@ proc parsecommit {id contents listed} {
     set header [string range $contents 0 [expr {$hdrend - 1}]]
     set comment [string range $contents [expr {$hdrend + 2}] end]
     foreach line [split $header "\n"] {
+	set line [split $line " "]
 	set tag [lindex $line 0]
 	if {$tag == "author"} {
 	    set audate [lindex $line end-1]
-	    set auname [lrange $line 1 end-2]
+	    set auname [join [lrange $line 1 end-2] " "]
 	} elseif {$tag == "committer"} {
 	    set comdate [lindex $line end-1]
-	    set comname [lrange $line 1 end-2]
+	    set comname [join [lrange $line 1 end-2] " "]
 	}
     }
     set headline {}
-- 
1.6.1.rc3.334.g7365d

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-18  9:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-18  9:26 [PATCH] gitk: Allow unbalanced quotes/braces in commit headers Kevin Ballard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.