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

Re: Shell aliases & paths

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 4, 2010, 21:11 UTC
Message-ID
<20100504211122.GA15091@progeny.tock>
In-Reply-To
<19424.34226.564684.613674@winooski.ccs.neu.edu>
Eli Barzilay wrote:
Show 5 quoted lines
> AFAICT, a shell command alias (one that starts with a "!") is executed
> from the repository root, but to make things worse it looks like there
> is no way to tell which directory it was executed from.  If this is
> correct, then these aliases are useless for anything that need to
> accept relative paths.  Is there something obvious that I'm missing?

Not that I can see. Maybe a new GIT_PATHNAME_PREFIX environment variable would help.

If we were starting from scratch, it might be nice to make aliases suppress the chdir to toplevel. Unfortunately, that would probably break some existing aliases. Another possibility would be to use some alternative convention (like [alias] foo = "# bar") to suppress the repository search. At that point, why not just add a git-foo script to $PATH? (‘git foo’ will still call it.)

Hope that helps, Jonathan

Previous: Eli BarzilayNext: Eli Barzilay
Message 2 of 5 in “Shell aliases & paths”
  1. Eli BarzilayMay 4, 2010
  2. Jonathan NiederMay 4, 2010
  3. Eli BarzilayMay 4, 2010
  4. Jonathan NiederMay 4, 2010
  5. Eli BarzilayMay 4, 2010

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.