git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] handle_alias: provide GIT_PREFIX to !alias

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Apr 27, 2011, 09:06 UTC
Message-ID
<BANLkTi=gjuOqLEArk_0Nj1faEu62dzjbZA@mail.gmail.com>
In-Reply-To
<5058a9853a75bff71187f553e67632997761de44.1303893279.git.git@drmicha.warpmail.net>
2011/4/27 Michael J Gruber <git@drmicha.warpmail.net>:
Show 6 quoted lines
> @@ -589,6 +589,8 @@ it will be treated as a shell command.  For example, defining
>  "gitk --all --not ORIG_HEAD".  Note that shell commands will be
>  executed from the top-level directory of a repository, which may
>  not necessarily be the current directory.
> +'GIT_PREFIX' is set as returned by running 'git rev-parse --show-prefix'
> +from the original current directory. See linkgit:git-rev-parse[1].

It made me wonder "but then why should not we just do GIT_PREFIX=`git rev-parse --show-prefix` in the alias?" then realized by the time we do that, it's already too late. Maybe

> +'GIT_PREFIX' is set as returned by running 'git rev-parse --show-prefix'
> +before current directory is changed to top-level directory. See linkgit:git-rev-parse[1].
?
-- 
Duy
Previous: Michael J GruberNext: Michael J Gruber
Message 11 of 12 in “handle_alias: provide GIT_CWD to !alias”
  1. handle_alias: provide GIT_CWD to !aliasMichael J Gruber, Apr 13, 2011
  2. Nguyen Thai Ngoc DuyApr 13, 2011
  3. Michael J GruberApr 13, 2011
  4. Nguyen Thai Ngoc DuyApr 13, 2011
  5. Junio C HamanoApr 26, 2011
  6. Michael J GruberApr 27, 2011
  7. Nguyen Thai Ngoc DuyApr 27, 2011
  8. Michael J GruberApr 27, 2011
  9. 1/2 t1020: test !alias in subdirectoryMichael J Gruber, Apr 27, 2011
  10. 2/2 handle_alias: provide GIT_PREFIX to !aliasMichael J Gruber, Apr 27, 2011
  11. Nguyen Thai Ngoc DuyApr 27, 2011
  12. Michael J GruberApr 27, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.