# [PATCH] gitk: Do not mistake unchanged lines with submodule changes

2 messages from 2019-03-23 to 2019-09-15. Participants: Gabriele Mazzotta, Paul Mackerras.
Thread: https://gitlist.dev/t/50811

## Gabriele Mazzotta, 2019-03-23 17:00

Subject: [PATCH] gitk: Do not mistake unchanged lines with submodule changes
Message-ID: <20190323170036.21533-1-gabriele.mzt@gmail.com>
URL: https://gitlist.dev/e/20190323170036.21533-1-gabriele.mzt%40gmail.com

```
Unchanged lines are prefixed with a white-space, thus unchanged lines
starting with either " <" or " >" are mistaken for submodule changes.
Check if a line starts with either "  <" or "  >" only if we listing
the changes of a submodule.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
 gitk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index a14d7a1..dd4bbbf 100755
--- a/gitk
+++ b/gitk
@@ -8191,11 +8191,11 @@ proc parseblobdiffline {ids line} {
 	} else {
 	    $ctext insert end "$line\n" filesep
 	}
-    } elseif {![string compare -length 3 "  >" $line]} {
+    } elseif {$currdiffsubmod != "" && ![string compare -length 3 "  >" $line]} {
 	set $currdiffsubmod ""
 	set line [encoding convertfrom $diffencoding $line]
 	$ctext insert end "$line\n" dresult
-    } elseif {![string compare -length 3 "  <" $line]} {
+    } elseif {$currdiffsubmod != "" && ![string compare -length 3 "  <" $line]} {
 	set $currdiffsubmod ""
 	set line [encoding convertfrom $diffencoding $line]
 	$ctext insert end "$line\n" d0
-- 
2.20.1


```

## Paul Mackerras, 2019-09-15 23:08

Subject: Re: [PATCH] gitk: Do not mistake unchanged lines with submodule changes
Message-ID: <20190915230821.GC9560@blackberry>
URL: https://gitlist.dev/e/20190915230821.GC9560%40blackberry
In-Reply-To: <20190323170036.21533-1-gabriele.mzt@gmail.com>

```
On Sat, Mar 23, 2019 at 06:00:36PM +0100, Gabriele Mazzotta wrote:
> Unchanged lines are prefixed with a white-space, thus unchanged lines
> starting with either " <" or " >" are mistaken for submodule changes.
> Check if a line starts with either "  <" or "  >" only if we listing
> the changes of a submodule.
> 
> Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>

Thanks, patch applied to my git://ozlabs.org/~paulus/gitk.git repository.

Paul.

```
