git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
RFRobert Fitzsimons <robfitz@273k.net>
Date
Mar 7, 2006, 20:46 UTC
Message-ID
<20060307204648.GA13620@localhost>
In-Reply-To
<440DE262.7020007@gmail.com>

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@273k.net>
---
 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
Previous: Jacob KroonNext: Paul Mackerras
Message 2 of 3 in “gitk : Lines not showing up in diff”
  1. Jacob KroonMar 7, 2006
  2. gitk : fix missing lines when displaying diff.Robert Fitzsimons, Mar 7, 2006
  3. Paul MackerrasMar 7, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.