From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH 4/8] trace: refactor to support multiple env variables
Date: Thu, 24 Feb 2011 10:25:04 -0800 [thread overview]
Message-ID: <7vsjvd1e9r.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 20110224142841.GD15477@sigill.intra.peff.net
Jeff King <peff@peff.net> writes:
> Right now you turn all tracing off and on with GIT_TRACE. To
> support new types of tracing without forcing the user to see
> all of them, we will soon support turning each tracing area
> on with GIT_TRACE_*.
>
> This patch lays the groundwork by providing an interface
> which does not assume GIT_TRACE. However, we still maintain
> the trace_printf interface so that existing callers do not
> need to be refactored.
One thing I found missing in the patch description is a statement of the
overall design and expected usage. It appears to me that the design is
built around the idea to give each named/namable area to be traceable its
own trace output file descriptor, so that different kinds of trace events
are sent to different files.
I however expect that majority of "trace only areas A and B" users would
want to see logs of events from these two areas in the same stream to see
them in the order they happened. Perhaps you are envisioning that these
users would use redirection from the command line to send GIT_TRACE_A and
GIT_TRACE_B to the same place; that probably needs to be spelled out more
explicitly somewhere in the documentation, as that would be a more common
thing to do.
I think your [7/8] is kind of strange when viewed in that light. Imagine
what would happen if you gave separate GIT_TRACE_* to each packet class,
instead of giving them a single umbrella variable GIT_TRACE_PACKET. If
the user wants to see them all in a single stream, the same redirection
you would use to unify GIT_TRACE_A and GIT_TRACE_B can be used.
Instead, you have packet class prefix in the output so that later the
different kinds of packet events can be sifted out from the unified
output, even though they are forced to go to the same output stream. In a
sense, you have two-tier classification system for traceable events (the
top layer that can be separated or merged at the file descriptor level,
and the bottom layer that can only be separated by looking at the prefix).
Is this necessarily a good thing (not a rhetorical question)?
To put it another and opposite way, I wonder if it would be better to
instead use a single output stream named by GIT_TRACE and add trace event
class prefix to the output for classes like SETUP and PACKET (again, not a
rhetorical question).
Also instead of wasting environment variable names, it might be a more
compact design from the user's point of view if we took a list of trace
event classes in a single environment variable, e.g.
GIT_TRACE_CLASS=setup,packet \
GIT_TRACE=/tmp/tr \
git push
I dunno.
next prev parent reply other threads:[~2011-02-24 18:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-24 14:23 [PATCH/RFC 0/8] refactor trace code Jeff King
2011-02-24 14:26 ` [RFC/PATCH 1/8] compat: provide a fallback va_copy definition Jeff King
2011-02-24 15:57 ` Erik Faye-Lund
2011-03-08 8:33 ` [PATCH jk/strbuf-vaddf] compat: fall back on __va_copy if available Jonathan Nieder
2011-03-08 20:09 ` Junio C Hamano
2011-03-08 20:59 ` Jonathan Nieder
2011-02-24 20:33 ` [RFC/PATCH 1/8] compat: provide a fallback va_copy definition Jonathan Nieder
2011-02-24 14:27 ` [PATCH 2/8] strbuf: add strbuf_addv Jeff King
2011-02-24 15:05 ` Christian Couder
2011-02-24 15:07 ` Jeff King
2011-02-24 20:51 ` Jonathan Nieder
2011-02-24 14:28 ` [PATCH 3/8] trace: add trace_vprintf Jeff King
2011-02-24 21:08 ` Jonathan Nieder
2011-02-24 14:28 ` [PATCH 4/8] trace: refactor to support multiple env variables Jeff King
2011-02-24 18:25 ` Junio C Hamano [this message]
2011-02-24 19:02 ` Jeff King
2011-02-24 19:44 ` Junio C Hamano
2011-02-24 19:48 ` Jeff King
2011-02-24 20:50 ` Junio C Hamano
2011-02-24 21:23 ` Jonathan Nieder
2011-02-24 14:28 ` [PATCH 5/8] trace: factor out "do we want to trace" logic Jeff King
2011-02-24 15:07 ` Christian Couder
2011-02-24 14:29 ` [PATCH 6/8] trace: add trace_strbuf Jeff King
2011-02-24 14:30 ` [PATCH 7/8] add packet tracing debug code Jeff King
2011-02-24 21:44 ` Jonathan Nieder
2011-02-24 14:30 ` [PATCH 8/8] trace: give repo_setup trace its own key Jeff King
2011-02-24 15:59 ` Andreas Ericsson
2011-02-24 16:05 ` Jeff King
2011-02-24 20:01 ` Christian Couder
2011-02-24 21:49 ` Jonathan Nieder
2011-02-25 6:38 ` Nguyen Thai Ngoc Duy
2011-02-26 8:34 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vsjvd1e9r.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).