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

Re: git alias question

From
Miles Bader <miles@gnu.org>
Date
Dec 29, 2011, 03:21 UTC
Message-ID
<87wr9g2hcd.fsf@catnip.gol.com>
In-Reply-To
<CAFLRbopjqW7OEWN4kxy+6Gb828h4zBC_h=4WiP-q1__LeezxUw@mail.gmail.com>
Michael Horowitz <michael.horowitz@ieee.org> writes:
Show 8 quoted lines
> I was able to make the following 2 aliases, which work perfectly
> except for one problem...
>
> ldiff = "!git diff `git rev-list --reverse -n 2 HEAD -- $1` -- $1"
> ldifft = "!git difftool `git rev-list --reverse -n 2 HEAD -- $1` -- $1"
>
> The problem is the limitation that shell commands are always executed
> at the top-level directory of the repository.

Hmmm, it'd be cool if git exported an environment variable containing the CWD when it invoked external aliases like this...!

-Miles
-- 
Love is the difficult realization that something other than oneself is real.
[Iris Murdoch]
Previous: Michael HorowitzNext: Junio C Hamano
Message 2 of 8 in “git alias question”
  1. Michael HorowitzDec 29, 2011
  2. Miles BaderDec 29, 2011
  3. Junio C HamanoDec 29, 2011
  4. Dave BorowitzDec 29, 2011
  5. David AguilarDec 30, 2011
  6. Michael HorowitzDec 31, 2011
  7. Jakub NarebskiDec 31, 2011
  8. Michael HorowitzJan 2, 2012

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.