From: Thomas Rast Date: Sun, 09 Jun 2013 19:44:13 GMT Subject: [PATCH gitk 2/4] gitk: split out diff part in $commitinfo Message-ID: In-Reply-To: So far we just parsed everything after the headers into the "comment" bit of $commitinfo, including notes and -- if you gave weird options -- the diff. Split out the diff, if any, into a separate field. It's easy to recognize, since the log message is indented but the /^diff / that starts a diff is not. Signed-off-by: Thomas Rast --- gitk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 81dce20..261bda8 100755 --- a/gitk +++ b/gitk @@ -1704,8 +1704,14 @@ proc parsecommit {id contents listed} { set comment $newcomment } set hasnote [string first "\nNotes:\n" $contents] + set diff "" + set i [string first "\ndiff" $comment] + if {$i >= 0} { + set diff [string range $comment $i end] + set comment [string range $comment 0 $i] + } set commitinfo($id) [list $headline $auname $audate \ - $comname $comdate $comment $hasnote] + $comname $comdate $comment $hasnote $diff] } proc getcommit {id} { -- 1.8.3.496.g0d0267b