{"thread":{"id":"14157","subject":"Git aliases executed from wrong dir","startedAt":"2008-06-25T23:44:49Z","lastAt":"2008-08-16T03:46:32Z","messageCount":3,"participants":["Kevin Ballard","Jānis Rūcis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"81214","messageId":"9777229F-27FD-4CB2-A5C7-6CA15733B8D2@sb.org","threadId":"14157","inReplyTo":null,"subject":"Git aliases executed from wrong dir","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-06-25T23:44:49Z","receivedAt":"2008-06-25T23:44:49Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"If I create an alias with `git config alias.foo '!pwd'` and then run  \nit from a subdirectory of my repo, it prints out the root of my repo.  \nThis prevents the ability to create aliases that take filenames, as  \nthey simply won't work if you try and reference a file from a  \nsubdirectory.\n\n-- \nKevin Ballard\nhttp://kevin.sb.org\nkevin@sb.org\nhttp://www.tildesoft.com\n"},{"id":"81215","messageId":"E9A68D2F-10AD-4779-AACB-6152A38D37C5@sb.org","threadId":"14157","inReplyTo":"9777229F-27FD-4CB2-A5C7-6CA15733B8D2@sb.org","subject":"Re: Git aliases executed from wrong dir","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-06-25T23:49:47Z","receivedAt":"2008-06-25T23:49:47Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"To clarify, this only appears to affect shell aliases (i.e. ones that  \nstart with !).\n\n   git config alias.foo 'ls-files'\n\nWorks fine from a subdir\n\n   git config alias.foo '!git ls-files'\n\nDoesn't behave right from a subdir.\n\n-Kevin Ballard\n\nOn Jun 25, 2008, at 4:44 PM, Kevin Ballard wrote:\n\n> If I create an alias with `git config alias.foo '!pwd'` and then run  \n> it from a subdirectory of my repo, it prints out the root of my  \n> repo. This prevents the ability to create aliases that take  \n> filenames, as they simply won't work if you try and reference a file  \n> from a subdirectory.\n>\n> -- \n> Kevin Ballard\n> http://kevin.sb.org\n> kevin@sb.org\n> http://www.tildesoft.com\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \nKevin Ballard\nhttp://kevin.sb.org\nkevin@sb.org\nhttp://www.tildesoft.com\n"},{"id":"87364","messageId":"20080816034632.GA16198@localhost.localdomain","threadId":"14157","inReplyTo":"9777229F-27FD-4CB2-A5C7-6CA15733B8D2@sb.org","subject":"Re: Git aliases executed from wrong dir","fromName":"Jānis Rūcis","fromEmail":"parasti@gmail.com","sentAt":"2008-08-16T03:46:32Z","receivedAt":"2008-08-16T03:46:32Z","isPatch":false,"sender":{"key":"parasti@gmail.com","avatar":null},"body":"On Wed, Jun 25, 2008 at 04:44:49PM -0700, Kevin Ballard wrote:\n> If I create an alias with `git config alias.foo '!pwd'` and then run it \n> from a subdirectory of my repo, it prints out the root of my repo. This \n> prevents the ability to create aliases that take filenames, as they \n> simply won't work if you try and reference a file from a subdirectory.\n\nGot bitten by the same problem.  I have an alias for the\ngit-new-workdir script and I'm tracking some config files in my home\ndirectory, but also have a bunch of Git repositories in\nsubdirectories.  A \"cd ..; git new-workdir old new\" in one of these\ntells me that \"old\" doesn't exist (because it doesn't exist in my home\ndir which the alias ends up being invoked from) while a \"git\nnew-workdir . ../new\" works as expected.\n"}]}