From: Nguyen Thai Ngoc Duy Date: Fri, 25 Feb 2011 06:38:25 GMT Subject: Re: [PATCH 8/8] trace: give repo_setup trace its own key Message-ID: In-Reply-To: <20110224214959.GH17412@elie> On Fri, Feb 25, 2011 at 4:49 AM, Jonathan Nieder 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_* >> @@ -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