{"thread":{"id":"24872","subject":"Treating similar blank lines between hunks as part of the hunks","startedAt":"2010-08-26T20:19:59Z","lastAt":"2010-08-27T02:13:10Z","messageCount":2,"participants":["Timur Tabi","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"149083","messageId":"AANLkTikZFYSSNMENC5SmKSVt49a+WxXdO0mP=V7Mbi-Q@mail.gmail.com","threadId":"24872","inReplyTo":null,"subject":"Treating similar blank lines between hunks as part of the hunks","fromName":"Timur Tabi","fromEmail":"timur@freescale.com","sentAt":"2010-08-26T20:19:59Z","receivedAt":"2010-08-26T20:19:59Z","isPatch":false,"sender":{"key":"timur@freescale.com","avatar":null},"body":"Is there any way to convince git-diff to treat blank lines between two\nhunks as part of the hunks for diffing?  That is, if I have these two\nfiles:\n\n-----\nA\nB\nC\n\nD\nE\n-----\n\nand\n\n-----\nA\nF\nG\n\nH\nE\n-----\n\ngit-diff will do this:\n\n A\n-B\n-C\n+F\n+G\n\n-D\n+H\n E\n\nInstead, I would prefer it did this:\n\n A\n-B\n-C\n-\n-D\n+F\n+G\n+\n+H\nE\n\nThis second diff is easier to read, especially when the number of\nhunks is large, but the size of each hunk is small.  This can happen\nin source code when one function is replaced with a completely\ndifferent function.  Git sees the blanks in each function as being\ncommon, but everything else is completely different, so the diff is\nunreabable.\n\n-- \nTimur Tabi\nLinux kernel developer at Freescale\n"},{"id":"149097","messageId":"20100827021310.GA23924@burratino","threadId":"24872","inReplyTo":"AANLkTikZFYSSNMENC5SmKSVt49a+WxXdO0mP=V7Mbi-Q@mail.gmail.com","subject":"Re: Treating similar blank lines between hunks as part of the hunks","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-27T02:13:10Z","receivedAt":"2010-08-27T02:13:10Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Timur Tabi wrote:\n\n> git-diff will do this:\n> \n>  A\n> -B\n> -C\n> +F\n> +G\n> \n> -D\n> +H\n>  E\n> \n> Instead, I would prefer it did this:\n> \n>  A\n> -B\n> -C\n> -\n> -D\n> +F\n> +G\n> +\n> +H\n> E\n> \n> This second diff is easier to read, especially when the number of\n> hunks is large, but the size of each hunk is small.  This can happen\n> in source code when one function is replaced with a completely\n> different function.\n\nNot sure if it would help in your example, but have you tried\n\"git diff --patience\"?\n"}]}