git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff: add --ignore-blank-lines option

From
Antoine Pelisse <apelisse@gmail.com>
Date
Jun 9, 2013, 20:32 UTC
Message-ID
<CALWbr2xijB+UD9gwc+HmMdHM9OT+2Lzr9w3h22=CegKHK-Ocng@mail.gmail.com>
In-Reply-To
<7vsj0roxnr.fsf@alter.siamese.dyndns.org>
On Sun, Jun 9, 2013 at 10:07 PM, Junio C Hamano <gitster@pobox.com> wrote:
> by
> the way, do we also handle deletions and do your new tests check
> them?

As stated in the commit message, yes we should, but we don't have tests for that. I will need to add some as I think I found a bug when removing blank lines.

Show 24 quoted lines
>> +     git diff --inter-hunk-context=100 --ignore-blank-lines >out.tmp &&
>> +     cat <<-\EOF >expected &&
>> +     diff --git a/x b/x
>> +     --- a/x
>> +     +++ b/x
>> +     @@ -1,7 +1,10 @@
>> +     +change
>> +      1
>> +      2
>> +     +
>> +      3
>> +      4
>> +     +
>> +      5
>> +      6
>> +      7
>> +     EOF
>> +     compare_diff_patch expected out.tmp
>> +'
>
> And from that point of view, this expected output may be excessively
> noisy.
>
> So I dunno.

It might be kind of noisy, but I think trying to improve the solution might lead to over-engineering. How would we compute the "minimal distance between interesting and blank" so that the blank becomes interesting ? Using the context size for that is quite convenient, while creating another variable would probably become overkill..

The original goal is to remove hunks created solely for addition/suppression, and I think it's what it should do for the moment. But of course, I have no strong opinion about that.

And by the way, I have also another bug, so you can expect another re-roll (sorry about that, it's more complex than I initially thought).

Thanks a lot, Antoine

Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 26 in “diff: add --ignore-blank-lines option”
  1. diff: add --ignore-blank-lines optionAntoine Pelisse, May 26, 2013
  2. Johannes SixtMay 26, 2013
  3. Antoine PelisseMay 27, 2013
  4. Antoine PelisseJun 1, 2013
  5. Junio C HamanoJun 4, 2013
  6. Antoine PelisseJun 4, 2013
  7. Junio C HamanoJun 4, 2013
  8. Antoine PelisseJun 4, 2013
  9. diff: add --ignore-blank-lines optionAntoine Pelisse, Jun 8, 2013
  10. Eric SunshineJun 9, 2013
  11. Junio C HamanoJun 9, 2013
  12. Antoine PelisseJun 9, 2013
  13. Junio C HamanoJun 9, 2013
  14. Antoine PelisseJun 10, 2013
  15. Junio C HamanoJun 10, 2013
  16. Antoine PelisseJun 12, 2013
  17. Junio C HamanoJun 12, 2013
  18. diff: add --ignore-blank-lines optionAntoine Pelisse, Jun 15, 2013
  19. Junio C HamanoJun 17, 2013
  20. Antoine PelisseJun 17, 2013
  21. Antoine PelisseJun 17, 2013
  22. Junio C HamanoJun 17, 2013
  23. Antoine PelisseJun 17, 2013
  24. Junio C HamanoJun 17, 2013
  25. diff: add --ignore-blank-lines optionAntoine Pelisse, Jun 19, 2013
  26. Junio C HamanoJun 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.