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

Re: [PATCH] t3701-add-interactive: tighten the check of trace output

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 10, 2018, 17:25 UTC
Message-ID
<xmqqin3dtgcy.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180910154453.GA15270@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> Not that I'm totally opposed to your patch, but it's a little sad that
> we have to match the specific text used in GIT_TRACE now (and if they
> ever changed we won't even notice, but rather the test will just become
> a silent noop).
>
> I think it would be nice if we could move towards something like:
>
>   - move current GIT_TRACE messages to use GIT_TRACE_COMMAND or similar
>
>   - abolish trace_printf() without a specific subsystem key
>
>   - do one of:
>
>     - keep GIT_TRACE as a historical synonym for GIT_TRACE_COMMAND; that
>       keeps things working as they are now
>
>     - have GIT_TRACE enable _all_ tracing; that's a change in behavior,
>       but arguably a more useful thing to have going forward (e.g., when
>       you're not sure which traces are even available)
>
> And then a test like this would just use GIT_TRACE_COMMAND.
Yup.  Sounds like a better world.
Show 15 quoted lines
>
>> diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
>> index 609fbfdc31..65dfbc033a 100755
>> --- a/t/t3701-add-interactive.sh
>> +++ b/t/t3701-add-interactive.sh
>> @@ -540,7 +540,7 @@ test_expect_success 'add -p does not expand argument lists' '
>>  	# update it, but we want to be sure that our "." pathspec
>>  	# was not expanded into the argument list of any command.
>>  	# So look only for "not-changed".
>> -	! grep not-changed trace.out
>> +	! grep -E "^trace: (built-in|exec|run_command): .*not-changed" trace.out
>
> I had a vague recollection that we preferred "egrep" to "grep -E" due to
> portability. But digging in the history, I could only find "fgrep" over
> "grep -F". And we seem to have plenty of "grep -E" invocations already.

I had the same reaction and came to the same conclusion. FWIW, the "favor fgrep over -F" was done by you with 87539416 ("tests: grep portability fixes", 2008-09-30).

Previous: Jeff KingNext: SZEDER Gábor
Message 5 of 7 in “t3701-add-interactive: tighten the check of trace output”
  1. t3701-add-interactive: tighten the check of trace outputSZEDER Gábor, Sep 10, 2018
  2. Taylor BlauSep 10, 2018
  3. Taylor BlauSep 18, 2018
  4. Jeff KingSep 10, 2018
  5. Junio C HamanoSep 10, 2018
  6. SZEDER GáborSep 10, 2018
  7. Jeff KingSep 10, 2018

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.