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

Re: [PATCH v9 2/3] t7507-commit-verbose: make test suite use write_script

From
Pranit Bauva <pranit.bauva@gmail.com>
Date
Mar 25, 2016, 06:55 UTC
Message-ID
<CAFZEwPPXPL=d2S+Htc+uFyrUfrWLZRk=7YFDevHNpuEB5ofVDQ@mail.gmail.com>
In-Reply-To
<CAPig+cRY8P2WtqR4y0zW+netCHa3=9Wnb8LmcB35SqP4OGC6Vg@mail.gmail.com>
On Fri, Mar 25, 2016 at 11:54 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 12 quoted lines
> On Fri, Mar 25, 2016 at 2:06 AM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
>> On Fri, Mar 25, 2016 at 5:27 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>>> Agreed that this needs proper justification in the commit message.
>>> And, the justification is to make each test more self-contained,
>>> particularly because a subsequent patch will introduce a second fake
>>> "editor", and by making tests responsible for setting the editor they
>>> need, they don't have to worry about bad interactions from "editors"
>>> set by earlier tests[1][2].
>>
>> This shou  cadve  mbe ave be ave be ave be ave be ave be ave be ave
>
> Hmm, yes, what you say makes perfect sense... er, wait...

haha :) Sorry for this. My browser crashed and it sent out some crap (don't know how). I mean to say, "This should have been mentioned in the commit message that scope of editor is reduced so as to not worry about bad interactions from other "editors" which may be used after wards."

Show 22 quoted lines
>
>>>>> -cat >check-for-diff <<EOF
>>>>> -#!$SHELL_PATH
>>>>> -exec grep '^diff --git' "\$1"
>>>>> +write_script "check-for-diff" <<-\EOF &&
>>>>> +grep '^diff --git' "$1" >out &&
>>>>> +test $(wc -l <out) = 1
>>>>
>>>> Our test lib offers the test_line_count helper function, which
>>>> outputs a helpful error message in case the number of lines do not
>>>> match.
>>>
>>> test_line_count() was mentioned in [2], however, this line counting is
>>> done in the fake "editor" script, not in the test script proper, so
>>> the spelled-out form $(wc ...) was proposed[2].
>>
>> I have a slight doubt regarding this. Can the functions from test-lib
>> work in such scripts flawlessly? If yes, then its probably better to
>> use them.
>
> Probably not easily, and it's not worth complicating the "editor"
> script by trying to import the test_line_count() function.
Sure!
Show 13 quoted lines
>>>>>  chmod +x check-for-diff
>>>
>>> Drop the 'chmod' line; write_script() does this for you.
>>
>> I was unaware about this. I will drop it off.
>
> I thought I had mentioned it in the review in which I had suggested
> using write_script() or one of the follow-up emails, but upon looking
> back at those messages, I saw it was not so. It turns out that I was
> probably thinking about a different patch review in which I had
> mentioned dropping 'chmod'[1].
>
> [1]: http://article.gmane.org/gmane.comp.version-control.git/288085/
Oh! I hadn't tested by removing chmod. I will try it for fun.
Previous: Eric SunshineNext: SZEDER Gábor
Message 7 of 23 in “parse-options.c: make OPTION__COUNTUP consider negative values”
  1. 1/3 parse-options.c: make OPTION__COUNTUP consider negative valuesPranit Bauva, Mar 24, 2016
  2. 2/3 t7507-commit-verbose: make test suite use write_scriptPranit Bauva, Mar 24, 2016
  3. 2/3 t7507-commit-verbose: make test suite use write_scriptSZEDER Gábor, Mar 24, 2016
  4. Eric SunshineMar 24, 2016
  5. Pranit BauvaMar 25, 2016
  6. Eric SunshineMar 25, 2016
  7. Pranit BauvaMar 25, 2016
  8. SZEDER GáborMar 25, 2016
  9. Pranit BauvaMar 25, 2016
  10. Eric SunshineMar 25, 2016
  11. Pranit BauvaMar 25, 2016
  12. Eric SunshineMar 25, 2016
  13. 3/3 commit: add a commit.verbose config variablePranit Bauva, Mar 24, 2016
  14. SZEDER GáborMar 24, 2016
  15. Pranit BauvaMar 24, 2016
  16. Pranit BauvaMar 24, 2016
  17. Eric SunshineMar 25, 2016
  18. Pranit BauvaMar 25, 2016
  19. 1/3 parse-options.c: make OPTION__COUNTUP consider negative valuesSZEDER Gábor, Mar 24, 2016
  20. Pranit BauvaMar 24, 2016
  21. Eric SunshineMar 24, 2016
  22. Pranit BauvaMar 28, 2016
  23. Eric SunshineMar 28, 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.