# Treating similar blank lines between hunks as part of the hunks

2 messages from 2010-08-26 to 2010-08-27. Participants: Timur Tabi, Jonathan Nieder.
Thread: https://gitlist.dev/t/24872

## Timur Tabi, 2010-08-26 20:19

Subject: Treating similar blank lines between hunks as part of the hunks
Message-ID: <AANLkTikZFYSSNMENC5SmKSVt49a+WxXdO0mP=V7Mbi-Q@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikZFYSSNMENC5SmKSVt49a%2BWxXdO0mP%3DV7Mbi-Q%40mail.gmail.com

```
Is there any way to convince git-diff to treat blank lines between two
hunks as part of the hunks for diffing?  That is, if I have these two
files:

-----
A
B
C

D
E
-----

and

-----
A
F
G

H
E
-----

git-diff will do this:

 A
-B
-C
+F
+G

-D
+H
 E

Instead, I would prefer it did this:

 A
-B
-C
-
-D
+F
+G
+
+H
E

This second diff is easier to read, especially when the number of
hunks is large, but the size of each hunk is small.  This can happen
in source code when one function is replaced with a completely
different function.  Git sees the blanks in each function as being
common, but everything else is completely different, so the diff is
unreabable.

-- 
Timur Tabi
Linux kernel developer at Freescale

```

## Jonathan Nieder, 2010-08-27 02:13

Subject: Re: Treating similar blank lines between hunks as part of the hunks
Message-ID: <20100827021310.GA23924@burratino>
URL: https://gitlist.dev/e/20100827021310.GA23924%40burratino
In-Reply-To: <AANLkTikZFYSSNMENC5SmKSVt49a+WxXdO0mP=V7Mbi-Q@mail.gmail.com>

```
Timur Tabi wrote:

> git-diff will do this:
> 
>  A
> -B
> -C
> +F
> +G
> 
> -D
> +H
>  E
> 
> Instead, I would prefer it did this:
> 
>  A
> -B
> -C
> -
> -D
> +F
> +G
> +
> +H
> E
> 
> This second diff is easier to read, especially when the number of
> hunks is large, but the size of each hunk is small.  This can happen
> in source code when one function is replaced with a completely
> different function.

Not sure if it would help in your example, but have you tried
"git diff --patience"?

```
