[PATCH gitk 2/4] gitk: split out diff part in $commitinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]