Re: [PATCH v2 01/10] t: add helper to convert object IDs to paths
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 19, 2019, 19:56 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1906192155560.44@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20190618165525.GN31952@szeder.dev>
Hi,
On Tue, 18 Jun 2019, SZEDER Gábor wrote:
Show 24 quoted lines
> On Tue, Jun 18, 2019 at 06:15:46PM +0200, Johannes Schindelin wrote: > > > Regardless of how it is implemented, I have another gripe with this > > > helper: the way it must be used requires a process: $(test_out_to_path > > > $foo) > > > > Indeed. > > > > > And looking through this patch series, I see a gazillion of *new* > > > process substitutions $(test_something...) and $(basename $whatever). > > > Can't we do something about it? > > > > I wish there was. Unix shell scripting has not evolved much in the past, > > what, 3 decades? So I don't really see a way to "pass variables by > > reference" to shell functions, short of calling `eval` (which buys > > preciously little as it _also_ has to spawn a new process [*1*]). > > > Footnote *1*: Theoretically, it could be a *ton* faster by using threads > > on Windows. But threads are pretty much an afterthought on Unix/Linux, so > > no mainstream POSIX shell supports this. They all `fork()` to interpret an > > `eval` as far as I can tell. > > 'eval' doesn't fork(). It can't possibly fork(), because if it did, > then any variables set in the eval-ed code snippet couldn't be visible > outside the 'eval'.
Good point. My brain must have made a couple of incorrect associations there.
Sorry, Dscho