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

Re: [PATCH v10 2/3] t7507-commit-verbose: store output of grep in a file

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 27, 2016, 17:08 UTC
Message-ID
<CAPig+cQyXi3_EwZakwrL3JahqZPFsJEifaTOB-KrZLtkxn5Oew@mail.gmail.com>
In-Reply-To
<CAPig+cS3usDDeTMzjqbxqi+k+XbmjawZ0TF20s9-vM6o=Fm=OQ@mail.gmail.com>

[forwarding this to the list, as well, since I again didn't notice when replying that Pranit had accidentally dropped the mailing list as a recipient]

On Sun, Mar 27, 2016 at 12:59 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 26 quoted lines
> On Sun, Mar 27, 2016 at 5:05 AM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
>> On Sun, Mar 27, 2016 at 12:40 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>>> However, even if you take the approach of making 'check-for-diff'
>>> succeed unconditionally and always count diffs, the current
>>> implementation is still overly complicated. It would be much simpler
>>> to let 'check-for-diff' always create the output file, and then use
>>> "test_line_count = 0 out" when expecting no diffs than to sometimes
>>> create the output file and sometimes not. The shell '>' operator will
>>> truncate the file to zero size even before grep is invoked, so you
>>> don't need to worry that results from an earlier test will pollute
>>> 'out' for a subsequent test, even if grep finds no matches. Thus,
>>> 'check-for-diff' collapses to this tiny implementation:
>>>
>>>     grep '^diff --git' "$1" >out
>>>     exit 0
>>>
>>> Or, if you want to be terse:
>>>
>>>     grep '^diff --git' "$1" || exit 0 >out
>>
>> I tried using both of this and it gives an error
>
> These worked fine for me when I rewrote the test script before making
> the suggestion. You'll need to provide more information if you want to
> get to the bottom of the problem you experienced (for instance, show
> the exact code you used and the actual error message).
Previous: Eric Sunshine
Message 35 of 35 in “parse-options.c: make OPTION__COUNTUP understand "unspecified" values”
  1. 1/3 parse-options.c: make OPTION__COUNTUP understand "unspecified" valuesPranit Bauva, Mar 26, 2016
  2. 3/3 commit: add a commit.verbose config variablePranit Bauva, Mar 26, 2016
  3. Eric SunshineMar 27, 2016
  4. Pranit BauvaMar 27, 2016
  5. Eric SunshineMar 27, 2016
  6. Pranit BauvaMar 27, 2016
  7. SZEDER GáborMar 27, 2016
  8. Pranit BauvaMar 27, 2016
  9. SZEDER GáborMar 27, 2016
  10. Pranit BauvaMar 27, 2016
  11. Eric SunshineMar 27, 2016
  12. 2/3 t7507-commit-verbose: store output of grep in a filePranit Bauva, Mar 26, 2016
  13. Eric SunshineMar 27, 2016
  14. SZEDER GáborMar 27, 2016
  15. Pranit BauvaMar 27, 2016
  16. Eric SunshineMar 27, 2016
  17. Pranit BauvaMar 27, 2016
  18. Eric SunshineMar 27, 2016
  19. Pranit BauvaMar 27, 2016
  20. 1/4 test-parse-options: print quiet as integerPranit Bauva, Mar 31, 2016
  21. 3/4 t7507-commit-verbose: improve test coverage by testing number of diffsPranit Bauva, Mar 31, 2016
  22. Junio C HamanoMar 31, 2016
  23. Pranit BauvaMar 31, 2016
  24. 2/4 parse-options.c: make OPTION_COUNTUP respect "unspecified" valuesPranit Bauva, Mar 31, 2016
  25. Junio C HamanoMar 31, 2016
  26. Pranit BauvaMar 31, 2016
  27. Junio C HamanoMar 31, 2016
  28. Pranit BauvaMar 31, 2016
  29. Junio C HamanoMar 31, 2016
  30. 4/4 commit: add a commit.verbose config variablePranit Bauva, Mar 31, 2016
  31. Junio C HamanoMar 31, 2016
  32. Pranit BauvaMar 31, 2016
  33. Eric SunshineMar 27, 2016
  34. Eric SunshineMar 27, 2016
  35. Eric SunshineMar 27, 2016

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.