Re: [PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-26 Thread Junio C Hamano
Jeff King writes: > My other motive for trace.* was that we could have something like > "trace.prune", and have git-prune provide verbose debugging information. > We have custom patches like that on GitHub servers, which we've used to > debug occasional weirdness (e.g., you find that an object is

Re: [PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-18 Thread Duy Nguyen
On Thu, Jun 18, 2015 at 2:10 AM, Jeff King wrote: > On Wed, Jun 17, 2015 at 05:04:04PM +0700, Duy Nguyen wrote: > >> I wonder if we could do it a bit differently. Instead of >> GIT_TRACE_STDIN, I would add GIT_TRACE_HOOK that points to a script. >> Whenever a command is run via run-command interfa

Re: [PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 05:04:04PM +0700, Duy Nguyen wrote: > I wonder if we could do it a bit differently. Instead of > GIT_TRACE_STDIN, I would add GIT_TRACE_HOOK that points to a script. > Whenever a command is run via run-command interface, the actual > command line to be executed would be "

Re: [PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-17 Thread Duy Nguyen
On Wed, Jun 17, 2015 at 4:20 AM, Jeff King wrote: > On Tue, Jun 16, 2015 at 03:49:07PM -0400, Jeff King wrote: > >> Another option would be to stop trying to intercept stdin in git.c, and >> instead make this a feature of run-command.c. That is, right before we >> exec a process, tee its stdin the

Re: [PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-16 Thread Jeff King
On Tue, Jun 16, 2015 at 03:49:07PM -0400, Jeff King wrote: > Another option would be to stop trying to intercept stdin in git.c, and > instead make this a feature of run-command.c. That is, right before we > exec a process, tee its stdin there. That means that you cannot do: > > GIT_TRACE_STDIN

Re: [PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-16 Thread Jeff King
On Tue, Jun 16, 2015 at 03:37:16PM -0400, Jeff King wrote: > For instance: > > GIT_TRACE=/tmp/processes.out \ > GIT_TRACE_STDIN=/tmp/stdin.%p \ > git daemon ... > > After a fetch, processes.out will contain a line like: > > 15:19:08.275493 [pid=13196] git.c:348 trace: > bu

[PATCH 3/3] trace: add GIT_TRACE_STDIN

2015-06-16 Thread Jeff King
Sometimes tracing the invocation of git programs with GIT_TRACE is not quite enough to replay a situation; the interesting input to the program often comes over its standard input. For instance, if you want to replay a particular fetch (e.g., for performance analysis or debugging), you would want b