Re: [PATCH] Add ability to specify environment extension to run_command
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 21, 2007, 23:02 UTC
- Message-ID
- <7v7ir1dbl9.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20070521224828.GA10890@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 12 quoted lines
> There is no way to specify and override for the environment: there is > no visible user for it (yet, something in git-daemon could need it). > > Signed-off-by: Alex Riesen <raa.lkml@gmail.com> > --- > > Sven Verdoolaege, Mon, May 21, 2007 11:03:39 +0200: >> Could you sign-off on this for me so I can use it my patch set? >> > > So here it is. On top of the previos patch regarding chdir before > exec. Junio, if needed, I can resend that first patch about chdir.
Both of them in a row would be good, so yes, resend is appreciated.
Show 11 quoted lines
> @@ -76,6 +76,10 @@ int start_command(struct child_process *cmd)
> if (cmd->dir && chdir(cmd->dir))
> die("exec %s: cd to %s failed (%s)", cmd->argv[0],
> cmd->dir, strerror(errno));
> + if (cmd->env) {
> + for (; *cmd->env; cmd->env++)
> + putenv((char*)*cmd->env);
> + }
> if (cmd->git_cmd) {
> execv_git_cmd(cmd->argv);
> } else {I had a feeling that some callers needed to be able to unsetenv some. How would this patch help them, or are they outside of the scope?