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

Re: [PATCH] Allow combined diff to ignore white-spaces

From
Antoine Pelisse <apelisse@gmail.com>
Date
Mar 14, 2013, 15:51 UTC
Message-ID
<CALWbr2yU6Nwg3_7CD6XhvruaKrhvXbRS0bO6nO+GgavjO59+jQ@mail.gmail.com>
In-Reply-To
<7v7glayp4l.fsf@alter.siamese.dyndns.org>
On Thu, Mar 14, 2013 at 4:31 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 34 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes:
>
>> This form of 'echo' is not sufficiently portable. How about:
>>
>>       tr -d Q <<-\EOF >test &&
>>
>>       always coalesce
>>       eol space coalesce Q
>> ...
>>       EOF
>
> Much better.
>
>>> +test_expect_success 'check combined output (no ignore space)' '
>>> +    git show | test_i18ngrep "^-\s*eol spaces" &&
>>> ...
>>> +    git show | test_i18ngrep "^--\s*always coalesce"
>>
>> This loses the exit code of git show. We usually write this as
>>
>>       git show >actual &&
>>       grep "^- *eol spaces" &&
>>       grep "^- *eol space coalesce" &&
>>       ...
>>
>> (Same for later tests.)
>>
>> There is nothing i18n-ish in the test patterns. Use regular grep.
>>
>> BTW, there is compare_diff_patch() in diff-lib.sh. You can use it to
>> compare diff output to expected output. Then you do not need a grep
>> invocation for each line of the test file.
>
> All good suggestions.  Thanks.

OK Very good, I will resubmit tonight. I was indeed not really sure about the best way to test here. Thanks for the tips and confirmation !

Cheers,
Previous: Junio C HamanoNext: Antoine Pelisse
Message 11 of 13 in “Allow combined diff to ignore white-spaces”
  1. Allow combined diff to ignore white-spacesAntoine Pelisse, Mar 2, 2013
  2. Junio C HamanoMar 3, 2013
  3. Antoine PelisseMar 4, 2013
  4. Junio C HamanoMar 4, 2013
  5. Antoine PelisseMar 4, 2013
  6. Allow combined diff to ignore white-spacesAntoine Pelisse, Mar 13, 2013
  7. Junio C HamanoMar 13, 2013
  8. Junio C HamanoMar 13, 2013
  9. Johannes SixtMar 14, 2013
  10. Junio C HamanoMar 14, 2013
  11. Antoine PelisseMar 14, 2013
  12. Allow combined diff to ignore white-spacesAntoine Pelisse, Mar 14, 2013
  13. Junio C HamanoMar 14, 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.