Re: [PATCH 2/2] handle_alias: provide GIT_PREFIX to !alias
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Apr 27, 2011, 09:36 UTC
- Message-ID
- <4DB7E39C.1040609@drmicha.warpmail.net>
- In-Reply-To
- <BANLkTi=gjuOqLEArk_0Nj1faEu62dzjbZA@mail.gmail.com>
Nguyen Thai Ngoc Duy venit, vidit, dixit 27.04.2011 11:06:
Show 16 quoted lines
> 2011/4/27 Michael J Gruber <git@drmicha.warpmail.net>: >> @@ -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]. > > ?
Well, the text says already that the alias is not run from the "original current directory", so it's two ways of saying the same thing.
Michael