Re: [PATCH] environment.c: introduce SETUP_GIT_ENV helper macro

2016-02-27 Thread Alexander Kuleshov
Hello Junio, On Sun, Feb 28, 2016 at 12:50 AM, Junio C Hamano wrote: > Junio C Hamano writes: > > >> Please don't. A macro that hides "return" makes things harder to >> follow, not easier. I will consider it next time. > Having said that, I do think a higher-level macro that encapulates > the

Re: [PATCH] environment.c: introduce SETUP_GIT_ENV helper macro

2016-02-27 Thread Junio C Hamano
Junio C Hamano writes: > Alexander Kuleshov writes: > >> Let's move this to the SETUP_GIT_ENV helper macro to prevent >> code duplication in these functions. > > Please don't. A macro that hides "return" makes things harder to > follow, not easier. >> >> +#define SETUP_GIT_ENV(env)

Re: [PATCH] environment.c: introduce SETUP_GIT_ENV helper macro

2016-02-27 Thread Junio C Hamano
Alexander Kuleshov writes: > The environment.c contans a couple of functions which are > consist from the following pattern: > > if (!env) > setup_git_env(); > return env; > > Let's move this to the SETUP_GIT_ENV helper macro to prevent > code duplication in these

[PATCH] environment.c: introduce SETUP_GIT_ENV helper macro

2016-02-27 Thread Alexander Kuleshov
The environment.c contans a couple of functions which are consist from the following pattern: if (!env) setup_git_env(); return env; Let's move this to the SETUP_GIT_ENV helper macro to prevent code duplication in these functions. Signed-off-by: Alexander Kuleshov