Re: [PATCH 8/8] trace: give repo_setup trace its own key
From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:50:39
On Fri, Feb 25, 2011 at 4:49 AM, Jonathan Nieder [off-list ref] wrote:
Jeff King wrote:quoted
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_*
quoted
@@ -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) variable
Yeah 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