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

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

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 27, 2011, 06:47 UTC
Message-ID
<4DB7BBEF.8010409@drmicha.warpmail.net>
In-Reply-To
<7v1v0od557.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 27.04.2011 00:22:
Show 7 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> Provide an environment variable GIT_CWD which contains the subdirectory
>> from which a !alias was called since these cd to the to level directory
>> before they are executed.
> 
> Isn't this what we usually call "prefix", though?

In code it is called "prefix". But I have to ask: So what? Are you suggesting GIT_PREFIX? User expectation is probably more tied to CWD, unless a user knows "rev-parse --show-prefix". I don't care about the name, and GIT_PREFIX may be more systematic.

A more important point is the prefix-less case (i.e. we are in topdir): Should GIT_YOUNAMEIT be empty then? I would say yes (just like "rev-parse --show-prefix"), Duy said no. We need a third vote :)

Also, we may want to scrap this altogether and do !!-aliases instead (without chdir).

Michael
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 6 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.