git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Feature or a bug: git aliases are executed in git-root directory
@ 2010-04-14 11:18 Jens Otten
  2010-04-14 13:10 ` Sverre Rabbelier
  2010-04-16  8:34 ` David Aguilar
  0 siblings, 2 replies; 3+ messages in thread
From: Jens Otten @ 2010-04-14 11:18 UTC (permalink / raw)
  To: git

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?

thanks for your help
jens

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Feature or a bug: git aliases are executed in git-root directory
  2010-04-14 11:18 Feature or a bug: git aliases are executed in git-root directory Jens Otten
@ 2010-04-14 13:10 ` Sverre Rabbelier
  2010-04-16  8:34 ` David Aguilar
  1 sibling, 0 replies; 3+ messages in thread
From: Sverre Rabbelier @ 2010-04-14 13:10 UTC (permalink / raw)
  To: Jens Otten; +Cc: git

Heya,

On Wed, Apr 14, 2010 at 13:18, Jens Otten <j.otten@plusserver.de> wrote:
> is there a way to solve this problem?

Yes, put this script in your path (and make it executable):

cat > git-meld << EOF
#!/bin/sh

GIT_EXTERNAL_DIFF='git-diff-to-meld-redirect' git diff "$@"
EOF

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Feature or a bug: git aliases are executed in git-root directory
  2010-04-14 11:18 Feature or a bug: git aliases are executed in git-root directory Jens Otten
  2010-04-14 13:10 ` Sverre Rabbelier
@ 2010-04-16  8:34 ` David Aguilar
  1 sibling, 0 replies; 3+ messages in thread
From: David Aguilar @ 2010-04-16  8:34 UTC (permalink / raw)
  To: Jens Otten; +Cc: git

On Wed, Apr 14, 2010 at 01:18:27PM +0200, Jens Otten wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-16  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14 11:18 Feature or a bug: git aliases are executed in git-root directory Jens Otten
2010-04-14 13:10 ` Sverre Rabbelier
2010-04-16  8:34 ` David Aguilar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).