Re: range-diff should suppress context-only changes?
- From
Johannes Altmanninger <aclopte@gmail.com>
- Date
- Nov 17, 2020, 21:35 UTC
- Message-ID
- <20201117213551.2539438-1-aclopte@gmail.com>
- In-Reply-To
- <xmqqmtzvikwi.fsf@gitster.c.googlers.com>
Show 7 quoted lines
> > I wonder if it would be reasonable to suppress range-diff hunks in which > > all of the changed lines are context lines. > > Sounds like a reasonable thing to do. As we know the shape of what > is compared in the outer diff we should be able to accurately notice > where hunk boundaries are and a hunk whose change is only on context > lines.
Here are patches to ignore context-only changes in range-diff's output. I'm not completely happy with the changes, they feel a bit too hacky. Maybe someone has better ideas.
This still gives output like this one, that could be improved in future
1: 7a3dac8 ! 1: 119bc78 Change @@ some-other-file 7 8 9 - Old context line + New context line
-## file ## +## file => renamed-file ## @@ 1 -2
I think it should be
1: 7a3dac8 ! 1: 119bc78 Change -## file ## +## file => renamed-file ## @@ 1 -2
I'm not sure if this is a feasible improvement.
"## <filename> ##" normally is a diff section header (hence the "@@ some-other-file" hunk above) but here the section header itself is changed..