Re: [PATCH 8/8] trace: give repo_setup trace its own key
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Feb 25, 2011, 06:38 UTC
- Message-ID
- <AANLkTimC2gv4GjA6YT7H9KuPcwOApkPxRcbDEOvvv9M8@mail.gmail.com>
- In-Reply-To
- <20110224214959.GH17412@elie>
On Fri, Feb 25, 2011 at 4:49 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jeff King wrote: > >> You no longer get this output with GIT_TRACE=1; instead, you >> can do GIT_TRACE_SETUP=1.
Minor note. GIT_TRACE warning in test-lib.sh will need improvement for checking GIT_TRACE_*
Show 22 quoted lines
>> @@ -170,10 +171,10 @@ void trace_repo_setup(const char *prefix)
>> if (!prefix)
>> prefix = "(null)";
>>
>> - trace_printf("setup: git_dir: %s\n", quote_crnl(get_git_dir()));
>> - trace_printf("setup: worktree: %s\n", quote_crnl(git_work_tree));
>> - trace_printf("setup: cwd: %s\n", quote_crnl(cwd));
>> - trace_printf("setup: prefix: %s\n", quote_crnl(prefix));
>> + trace_printf_key(key, "setup: git_dir: %s\n", quote_crnl(get_git_dir()));
>> + trace_printf_key(key, "setup: worktree: %s\n", quote_crnl(git_work_tree));
>> + trace_printf_key(key, "setup: cwd: %s\n", quote_crnl(cwd));
>> + trace_printf_key(key, "setup: prefix: %s\n", quote_crnl(prefix));
>
> I wonder if it would make sense for this to be
>
> trace_printf("setup", "git_dir: %s\n", ...);
>
> and:
>
> - automatically prefix each line with the key instead of "trace:"
> - enable or redirect based on the content of the GIT_TRACE_$(uc $key)
> variableYeah I think it's nice to have key = "setup", then env name becomes GIT_TRACE_$(uc $key) and prepend "$key: " in all trace messages.
-- Duy