Re: [PATCH/RFC 0/3] trace: omit noisy repository discovery report
- From
Jeff King <peff@peff.net>
- Date
- Jan 26, 2011, 05:07 UTC
- Message-ID
- <20110126050715.GA2665@sigill.intra.peff.net>
- In-Reply-To
- <AANLkTimB0rJPLkwyrQEibngeRjgHLxhrntG5sMdQ9CW0@mail.gmail.com>
On Wed, Jan 26, 2011 at 08:45:12AM +0700, Nguyen Thai Ngoc Duy wrote:
Show 16 quoted lines
> > A few days ago I was tracing something or other and decided that these > > extra lines are annoying. > > > > Patch 1 moves this code from trace.c to git.c, to contain its impact > > to a single translation unit (that is, it let me experiment without > > touching cache.h after that). > > > > Patch 2 removes the repo-setup tracing code, introducing a > > test-repo-setup helper to take its place in the repo setup tests. > > > > Patch 3 does some cleaning up made possible by patch 2. > > > > Thoughts? > > I'm fine with this. Although long term maybe we should support pattern > matching or category selection in GIT_TRACE.
Yeah. I recently was peeking at the git protocol, and I wrote some nice-ish packet-tracing support. I triggered it via:
GIT_TRACE=$whatever GIT_TRACE_PACKET=1 git push ...
So you have to turn on tracing (to whatever destination you want) and then turn on packet tracing with a bool. In retrospect, probably GIT_TRACE_* should take the same type of location parameter as GIT_TRACE, so you can get whatever subset of trace going to wherever you like. And then the repo setup code can just go into GIT_TRACE_SETUP or something.
-Peff