Re: [PATCH 1/2] run-command: provide in_async query function

2015-09-01 Thread Jeff King
On Tue, Sep 01, 2015 at 03:09:56PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > It's not easy for arbitrary code to find out whether it is > > running in an async process or not. A top-level function > > which is fed to start_async() can know (you just pass down > > an argument saying

Re: [PATCH 1/2] run-command: provide in_async query function

2015-09-01 Thread Junio C Hamano
Jeff King writes: > It's not easy for arbitrary code to find out whether it is > running in an async process or not. A top-level function > which is fed to start_async() can know (you just pass down > an argument saying "you are async"). But that function may > call other global functions, and we

Re: [PATCH 1/2] run-command: provide in_async query function

2015-09-01 Thread Jeff King
On Tue, Sep 01, 2015 at 04:22:43PM -0400, Jeff King wrote: > diff --git a/run-command.c b/run-command.c > index 3277cf7..c8029f2 100644 > --- a/run-command.c > +++ b/run-command.c This diff is a little funny to read because the interesting context is far away, and it is not immediately obvious wh

[PATCH 1/2] run-command: provide in_async query function

2015-09-01 Thread Jeff King
It's not easy for arbitrary code to find out whether it is running in an async process or not. A top-level function which is fed to start_async() can know (you just pass down an argument saying "you are async"). But that function may call other global functions, and we would not want to have to pas