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

2 messages from 2018-10-21 to 2018-10-21. Participants: Dummy Name, Gabriele Mazzotta.
Thread: https://gitlist.dev/t/49629

## Dummy Name, 2018-10-21 16:34

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

```
From: Gabriele Mazzotta <gabriele.mzt@gmail.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.19.1


```

## Gabriele Mazzotta, 2018-10-21 16:39

Subject: Re: [PATCH] gitk: Do not mistake unchanged lines with submodule changes
Message-ID: <fcef23d5-e2b3-cb3a-9ccf-75a0cc126d0b@gmail.com>
URL: https://gitlist.dev/e/fcef23d5-e2b3-cb3a-9ccf-75a0cc126d0b%40gmail.com
In-Reply-To: <20181021163401.4458-1-dummy@example.com>

```
On 21/10/18 18:34, Dummy Name wrote:
> From: Gabriele Mazzotta <gabriele.mzt@gmail.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>

Hi,

I accidentally pressed Enter before I could set the committer
to the correct value. I can resend the patch if necessary.

Regards,
Gabriele

```
