git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitk : Lines not showing up in diff
@ 2006-03-07 19:43 Jacob Kroon
  2006-03-07 20:46 ` [PATCH] gitk : fix missing lines when displaying diff Robert Fitzsimons
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Kroon @ 2006-03-07 19:43 UTC (permalink / raw)
  To: paulus; +Cc: git

I "think" this is a bug in gitk:

If I have a textfile in which I remove or add a line that looks like 
"-----------...", it won't show up in the diff gitk produces. "cg-log" 
shows the line correctly being added or deleted.

I'm using gitk 1.2.4 (From Fedora, gitk-1.2.4-1.fc4)

//Jacob

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] gitk : fix missing lines when displaying diff.
  2006-03-07 19:43 gitk : Lines not showing up in diff Jacob Kroon
@ 2006-03-07 20:46 ` Robert Fitzsimons
  2006-03-07 22:17   ` Paul Mackerras
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Fitzsimons @ 2006-03-07 20:46 UTC (permalink / raw)
  To: Jacob Kroon; +Cc: paulus, git

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gitk : fix missing lines when displaying diff.
  2006-03-07 20:46 ` [PATCH] gitk : fix missing lines when displaying diff Robert Fitzsimons
@ 2006-03-07 22:17   ` Paul Mackerras
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2006-03-07 22:17 UTC (permalink / raw)
  To: Robert Fitzsimons; +Cc: Jacob Kroon, git

Robert Fitzsimons writes:

> 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.

Thanks for pointing out the easy fix.  I had been going to do
something much more complicated. :)

However, your patch didn't apply due to the whitespace being munged.
I committed an equivalent fix, but I took the opportunity to change
the [regexp] to a couple of [string compare]s as well.

Paul.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-07 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-07 19:43 gitk : Lines not showing up in diff Jacob Kroon
2006-03-07 20:46 ` [PATCH] gitk : fix missing lines when displaying diff Robert Fitzsimons
2006-03-07 22:17   ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).