gitk: Split out diff part in $commitinfo
[gitweb.git] / gitk
diff --git a/gitk b/gitk
index 79c8bb1573ca40508e597d451b0e4491a7f33d6e..7c961c598949b93afd3886700efd4466099130b4 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -1704,8 +1704,17 @@ proc parsecommit {id contents listed} {
        set comment $newcomment
     }
     set hasnote [string first "\nNotes:\n" $contents]
+    set diff ""
+    # If there is diff output shown in the git-log stream, split it
+    # out.  But get rid of the empty line that always precedes the
+    # diff.
+    set i [string first "\n\ndiff" $comment]
+    if {$i >= 0} {
+       set diff [string range $comment $i+1 end]
+       set comment [string range $comment 0 $i-1]
+    }
     set commitinfo($id) [list $headline $auname $audate \
-                            $comname $comdate $comment $hasnote]
+                            $comname $comdate $comment $hasnote $diff]
 }
 
 proc getcommit {id} {