Re: [RFC/PATCH] handle_alias: provide GIT_CWD to !alias

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 13, 2011 at 8:05 PM, Michael J Gruber
<git@xxxxxxxxxxxxxxxxxxxx> wrote:
> - Â Â Â Â Â Â Â Â Â Â Â ret = run_command_v_opt(alias_argv, RUN_USING_SHELL);
> + Â Â Â Â Â Â Â Â Â Â Â strbuf_addstr(&sb, "GIT_CWD=");
> + Â Â Â Â Â Â Â Â Â Â Â if (subdir)
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â strbuf_addstr(&sb, subdir);
> + Â Â Â Â Â Â Â Â Â Â Â env[0] = sb.buf;
> + Â Â Â Â Â Â Â Â Â Â Â env[1] = NULL;
> + Â Â Â Â Â Â Â Â Â Â Â ret = run_command_v_opt_cd_env(alias_argv, RUN_USING_SHELL, NULL, env);
> + Â Â Â Â Â Â Â Â Â Â Â strbuf_release(&sb);
> Â Â Â Â Â Â Â Â Â Â Â Âif (ret >= 0) Â /* normal exit */
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âexit(ret);

subdir can be NULL. I'm not sure if it can be empty string though. May
need a check and set it to '.' so "cd $GIT_CWD" does not go back to
$HOME.
-- 
Duy
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj· ŠßžØn‡r¡öë¨è&£ûz¹Þúzf£¢·hšˆ§~†­†Ûÿÿïÿ‘ê_èæ+v‰¨þ)ßø

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]