Re: [GSoC][RFC/PATCH v2] submodule: port subcommand foreach from shell to C
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Apr 24, 2017, 22:11 UTC
- Message-ID
- <efe8e82d-a021-5fc4-492a-e6e0ab7d52d3@ramsayjones.plus.com>
- In-Reply-To
- <CAGZ79kb1CR3qKOzByFC_wy7+Fh7cofFT1urhA06RuBK_3vGKmg@mail.gmail.com>
On 24/04/17 21:03, Stefan Beller wrote: [snip]
Show 11 quoted lines
> + > + argv_array_pushf(&cp.env_array, "name=%s", sub->name); > + argv_array_pushf(&cp.env_array, "path=%s", displaypath); > + argv_array_pushf(&cp.env_array, "sm_path=%s", displaypath); > > You mention keeping 'sm_path' in the notes after the commit message. I would > add that part to the commit message, to explain why we have multiple variables > that have the same value. Maybe even a comment in the code: > > /* Keep sm_path for historic reasons, see tests in 091a6eb0fee. */ > .. sm_path ..
Hmm, you need to be a bit careful with putting 'path' in the environment (if you then export it to sub-processes) on windows (cygwin, MinGW, GfW). See commit 64394e3ae9. I would have liked to remove $path altogether from the 'submodule-foreach api' in that commit, but users and their scripts were already using it (so I couldn't just drop it, without some deprecation period). So long as whatever was being 'eval'-ed in the script didn't export $path, ...
ATB, Ramsay Jones