From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] t3701-add-interactive: tighten the check of trace output
Date: Mon, 10 Sep 2018 21:19:32 +0200 [thread overview]
Message-ID: <20180910191932.GB17224@localhost> (raw)
In-Reply-To: <20180910154453.GA15270@sigill.intra.peff.net>
On Mon, Sep 10, 2018 at 11:44:54AM -0400, Jeff King wrote:
> On Mon, Sep 10, 2018 at 04:07:14PM +0200, SZEDER Gábor wrote:
>
> > The test 'add -p does not expand argument lists' in
> > 't3701-add-interactive.sh', added in 7288e12cce (add--interactive: do
> > not expand pathspecs with ls-files, 2017-03-14), checks the GIT_TRACE
> > of 'git add -p' to ensure that the name of a tracked file wasn't
> > passed around as argument to any of the commands executed as a result
> > of undesired pathspec expansion. This check is done with 'grep' using
> > the filename on its own as the pattern, which is too loose a pattern,
> > and would match any occurrences of the filename in the trace output,
> > not just those as command arguments. E.g. if a developer were to
> > litter the index handling code with trace_printf()s printing, among
> > other things, the name of the just processed cache entry, then that
> > pattern would mistakenly match these as well, and would fail the test.
>
> Is this a real thing we're running into?
Well, we, in general, don't, but that example mentioned in the commit
message does contain autobiographical elements :)
> I'd have thought that anybody
> adding index-specific tracing would do it as GIT_TRACE_INDEX.
Depends on the purpose, I guess. For tracing that is aimed to become
part of in git, definitely. However, for my own ad-hoc tracing used
to try to make sense of some split-index corner cases, trace_printf()
is perfect.
> It's
> unfortunate that "trace commands and processes" is just GIT_TRACE, and not
> GIT_TRACE_RUN or similar. But that's mostly historical. I wouldn't
> expect people to add other subsystems to it.
>
> Not that I'm totally opposed to your patch, but it's a little sad that
> we have to match the specific text used in GIT_TRACE now (and if they
> ever changed we won't even notice, but rather the test will just become
> a silent noop).
>
> I think it would be nice if we could move towards something like:
>
> - move current GIT_TRACE messages to use GIT_TRACE_COMMAND or similar
>
> - abolish trace_printf() without a specific subsystem key
Nah, please leave trace_printf() alone.
> - do one of:
>
> - keep GIT_TRACE as a historical synonym for GIT_TRACE_COMMAND; that
> keeps things working as they are now
>
> - have GIT_TRACE enable _all_ tracing; that's a change in behavior,
> but arguably a more useful thing to have going forward (e.g., when
> you're not sure which traces are even available)
>
> And then a test like this would just use GIT_TRACE_COMMAND.
Except for removing keyless trace_printf(), I agree.
next prev parent reply other threads:[~2018-09-10 19:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 14:07 [PATCH] t3701-add-interactive: tighten the check of trace output SZEDER Gábor
2018-09-10 14:18 ` Taylor Blau
2018-09-18 17:43 ` Taylor Blau
2018-09-10 15:44 ` Jeff King
2018-09-10 17:25 ` Junio C Hamano
2018-09-10 19:19 ` SZEDER Gábor [this message]
2018-09-10 19:33 ` Jeff King
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=20180910191932.GB17224@localhost \
--to=szeder.dev@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).