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

Re: Feature or a bug: git aliases are executed in git-root directory

From
David Aguilar <davvid@gmail.com>
Date
Apr 16, 2010, 08:34 UTC
Message-ID
<20100416083419.GA30372@gmail.com>
In-Reply-To
<4BC5A483.6060206@plusserver.de>
On Wed, Apr 14, 2010 at 01:18:27PM +0200, Jens Otten wrote:
Show 32 quoted lines
> Hi,
>
> i started to use git (version is 1.6.3.3 (ubuntu)) and it is really great!
>
> but i have one problem when using aliases. maybe i made a mistake, but  
> here is my problem.
>
> i set up my ~/.gitconfig as follows:
> ----------
> ...
> [alias]
>    meld = !GIT_EXTERNAL_DIFF='git-diff-to-meld-redirect' git diff
> ...
> ----------
>
> now when i work in a subdirectory of my git-root dir and want to make a  
> diff, this works perfectly:
> $ cd ~/git-root/subdir
> $ git diff some_file
>
> but when doing the same using the alias i get an error:
> $ cd ~/git-root/subdir
> $ git meld some_file
> fatal: ambiguous argument 'some_file': unknown revision or path not in  
> the working tree.
> Use '--' to separate paths from revisions
>
> whereas using the relative path starting from the git-root directory works
> $ cd ~/git-root/subdir
> $ git meld subdir/some_file
>
> is there a way to solve this problem?
Yes.  Use git-difftool =)
http://www.kernel.org/pub/software/scm/git/docs/git-difftool.html
git difftool -t meld -- <path>
> thanks for your help
> jens
HTH,
-- 
		David
Previous: Sverre Rabbelier
Message 3 of 3 in “Feature or a bug: git aliases are executed in git-root directory”
  1. Jens OttenApr 14, 2010
  2. Sverre RabbelierApr 14, 2010
  3. David AguilarApr 16, 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.