{"thread":{"id":"23455","subject":"Feature or a bug: git aliases are executed in git-root directory","startedAt":"2010-04-14T11:18:27Z","lastAt":"2010-04-16T08:34:21Z","messageCount":3,"participants":["Jens Otten","Sverre Rabbelier","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"139469","messageId":"4BC5A483.6060206@plusserver.de","threadId":"23455","inReplyTo":null,"subject":"Feature or a bug: git aliases are executed in git-root directory","fromName":"Jens Otten","fromEmail":"j.otten@plusserver.de","sentAt":"2010-04-14T11:18:27Z","receivedAt":"2010-04-14T11:18:27Z","isPatch":false,"sender":{"key":"j.otten@plusserver.de","avatar":null},"body":"Hi,\n\ni started to use git (version is 1.6.3.3 (ubuntu)) and it is really great!\n\nbut i have one problem when using aliases. maybe i made a mistake, but \nhere is my problem.\n\ni set up my ~/.gitconfig as follows:\n----------\n...\n[alias]\n    meld = !GIT_EXTERNAL_DIFF='git-diff-to-meld-redirect' git diff\n...\n----------\n\nnow when i work in a subdirectory of my git-root dir and want to make a \ndiff, this works perfectly:\n$ cd ~/git-root/subdir\n$ git diff some_file\n\nbut when doing the same using the alias i get an error:\n$ cd ~/git-root/subdir\n$ git meld some_file\nfatal: ambiguous argument 'some_file': unknown revision or path not in \nthe working tree.\nUse '--' to separate paths from revisions\n\nwhereas using the relative path starting from the git-root directory works\n$ cd ~/git-root/subdir\n$ git meld subdir/some_file\n\nis there a way to solve this problem?\n\nthanks for your help\njens\n"},{"id":"139472","messageId":"g2hfabb9a1e1004140610mdd7b093arb15758ba40fd7956@mail.gmail.com","threadId":"23455","inReplyTo":"4BC5A483.6060206@plusserver.de","subject":"Re: Feature or a bug: git aliases are executed in git-root directory","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-04-14T13:10:42Z","receivedAt":"2010-04-14T13:10:42Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Apr 14, 2010 at 13:18, Jens Otten <j.otten@plusserver.de> wrote:\n> is there a way to solve this problem?\n\nYes, put this script in your path (and make it executable):\n\ncat > git-meld << EOF\n#!/bin/sh\n\nGIT_EXTERNAL_DIFF='git-diff-to-meld-redirect' git diff \"$@\"\nEOF\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"139660","messageId":"20100416083419.GA30372@gmail.com","threadId":"23455","inReplyTo":"4BC5A483.6060206@plusserver.de","subject":"Re: Feature or a bug: git aliases are executed in git-root directory","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2010-04-16T08:34:21Z","receivedAt":"2010-04-16T08:34:21Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Apr 14, 2010 at 01:18:27PM +0200, Jens Otten wrote:\n> Hi,\n>\n> i started to use git (version is 1.6.3.3 (ubuntu)) and it is really great!\n>\n> but i have one problem when using aliases. maybe i made a mistake, but  \n> here is my problem.\n>\n> i set up my ~/.gitconfig as follows:\n> ----------\n> ...\n> [alias]\n>    meld = !GIT_EXTERNAL_DIFF='git-diff-to-meld-redirect' git diff\n> ...\n> ----------\n>\n> now when i work in a subdirectory of my git-root dir and want to make a  \n> diff, this works perfectly:\n> $ cd ~/git-root/subdir\n> $ git diff some_file\n>\n> but when doing the same using the alias i get an error:\n> $ cd ~/git-root/subdir\n> $ git meld some_file\n> fatal: ambiguous argument 'some_file': unknown revision or path not in  \n> the working tree.\n> Use '--' to separate paths from revisions\n>\n> whereas using the relative path starting from the git-root directory works\n> $ cd ~/git-root/subdir\n> $ git meld subdir/some_file\n>\n> is there a way to solve this problem?\n\nYes.  Use git-difftool =)\n\nhttp://www.kernel.org/pub/software/scm/git/docs/git-difftool.html\n\ngit difftool -t meld -- <path>\n\n\n\n> thanks for your help\n> jens\n\nHTH,\n\n-- \n\t\tDavid\n"}]}