[PATCH gitk 2/4] gitk: split out diff part in $commitinfo
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Jun 9, 2013, 19:44 UTC
- Message-ID
- <d69e0570e081412e0fdc0d5cbf1ddbc32df09575.1370806329.git.trast@inf.ethz.ch>
- In-Reply-To
- <cover.1370806329.git.trast@inf.ethz.ch>
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 <trast@inf.ethz.ch> --- 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