[PATCH] gitk : fix missing lines when displaying diff.

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

 



Lines which are added (removed) and begin with +++ (---) are not shown
correctly when displaying in the diff panel.

The +++ and --- lines are part of the diff header, with the +++
indicating the end of the header.

Signed-off-by: Robert Fitzsimons <robfitz@xxxxxxxx>


---

 gitk |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

d0da9f04cf565df64a954e1bfd4c5c0913b83322
diff --git a/gitk b/gitk
index f4c6624..5e3c34c 100755
--- a/gitk
+++ b/gitk
@@ -2595,8 +2595,10 @@ proc getblobdiffline {bdf ids} {
        set pad [string range "----------------------------------------" 1 $l]
        $ctext insert end "$pad $header $pad\n" filesep
        set diffinhdr 1
-    } elseif {[regexp {^(---|\+\+\+)} $line]} {
-       set diffinhdr 0
+    } elseif {$diffinhdr == 1 && [regexp {^(---|\+\+\+) } $line]} {
+       if {[regexp {^\+\+\+ } $line]} {
+           set diffinhdr 0
+       }
     } elseif {[regexp {^@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@(.*)} \
                   $line match f1l f1c f2l f2c rest]} {
        $ctext insert end "$line\n" hunksep
--
1.2.3.g20d2

-
: 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]