{"thread":{"id":"44058","subject":"Bug: git-add .* errors out","startedAt":"2016-09-11T19:10:33Z","lastAt":"2016-09-12T06:00:00Z","messageCount":4,"participants":["Pranit Bauva","Andreas Schwab","Thomas Gummerer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"301665","messageId":"CAFZEwPPSiy1dxZgxWg1saPcw2QWgHtZKx26oSN3g1mCv25=0AA@mail.gmail.com","threadId":"44058","inReplyTo":null,"subject":"Bug: git-add .* errors out","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-09-11T19:10:27Z","receivedAt":"2016-09-11T19:10:33Z","isPatch":false,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"Hey everyone,\n\nOne of my friend was trying to add files using the command `git add\n.*` and got an error that \"fatal: ..: '..' is outside repository\"\nwhich did seem a little obvious to me. But then I tried to reproduce\nit in my machine with `git add \".*\"` and it didn't error out. I am\ncurrently using git 2.9.3 on Ubuntu 15.04 while he is using git 1.9.1\non Ubuntu 16.04. What might have gone wrong?\n\nRegards,\nPranit Bauva\n"},{"id":"301666","messageId":"87h99m8c2v.fsf@linux-m68k.org","threadId":"44058","inReplyTo":"CAFZEwPPSiy1dxZgxWg1saPcw2QWgHtZKx26oSN3g1mCv25=0AA@mail.gmail.com","subject":"Re: Bug: git-add .* errors out","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2016-09-11T19:34:48Z","receivedAt":"2016-09-11T19:34:59Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Sep 12 2016, Pranit Bauva <pranit.bauva@gmail.com> wrote:\n\n> One of my friend was trying to add files using the command `git add\n> .*` and got an error that \"fatal: ..: '..' is outside repository\"\n> which did seem a little obvious to me. But then I tried to reproduce\n> it in my machine with `git add \".*\"` and it didn't error out.\n\nProbably you were running it in a subdirectory.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"301667","messageId":"20160911193906.GC8254@hank","threadId":"44058","inReplyTo":"CAFZEwPPSiy1dxZgxWg1saPcw2QWgHtZKx26oSN3g1mCv25=0AA@mail.gmail.com","subject":"Re: Bug: git-add .* errors out","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2016-09-11T19:39:06Z","receivedAt":"2016-09-11T19:39:00Z","isPatch":false,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Hi,\n\nOn 09/12, Pranit Bauva wrote:\n> Hey everyone,\n> \n> One of my friend was trying to add files using the command `git add\n> .*` and got an error that \"fatal: ..: '..' is outside repository\"\n> which did seem a little obvious to me. But then I tried to reproduce\n> it in my machine with `git add \".*\"` and it didn't error out. I am\n> currently using git 2.9.3 on Ubuntu 15.04 while he is using git 1.9.1\n> on Ubuntu 16.04. What might have gone wrong?\n\nThe difference seems to be that you quoted the .*, which leaves the .*\nin place for gits internal pathspec machinery, which then only\nconsiders paths inside of the repository.\n\nThe non quoted version your friend used meanwhile is expanded by the\nshell itself, which seems to be expanding it to ., the current\ndirectory, and .., the parent directory.  This behaviour also depends\non the shell used, for me .* in bash includes the current as well as\nthe parent directory, while .* in zsh doesn't include either of these.\n\n> Regards,\n> Pranit Bauva\n\nHope this helps,\nThomas\n"},{"id":"301691","messageId":"CAFZEwPN=gBdBPmyxRDz8yLfTKAcGjAwW_mVUDGe+83JUNc4L3g@mail.gmail.com","threadId":"44058","inReplyTo":"20160911193906.GC8254@hank","subject":"Re: Bug: git-add .* errors out","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-09-12T05:59:54Z","receivedAt":"2016-09-12T06:00:00Z","isPatch":false,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"Hey Thomas,\n\nOn Mon, Sep 12, 2016 at 1:09 AM, Thomas Gummerer <t.gummerer@gmail.com> wrote:\n> Hi,\n>\n> On 09/12, Pranit Bauva wrote:\n>> Hey everyone,\n>>\n>> One of my friend was trying to add files using the command `git add\n>> .*` and got an error that \"fatal: ..: '..' is outside repository\"\n>> which did seem a little obvious to me. But then I tried to reproduce\n>> it in my machine with `git add \".*\"` and it didn't error out. I am\n>> currently using git 2.9.3 on Ubuntu 15.04 while he is using git 1.9.1\n>> on Ubuntu 16.04. What might have gone wrong?\n>\n> The difference seems to be that you quoted the .*, which leaves the .*\n> in place for gits internal pathspec machinery, which then only\n> considers paths inside of the repository.\n>\n> The non quoted version your friend used meanwhile is expanded by the\n> shell itself, which seems to be expanding it to ., the current\n> directory, and .., the parent directory.  This behaviour also depends\n> on the shell used, for me .* in bash includes the current as well as\n> the parent directory, while .* in zsh doesn't include either of these.\n\nThis seems to be a reasonable reason. I had guessed the behaviour of\nthe shell but didn't really know what was happening with the quoted\nversion. And I guess it cannot really be fixed because it depends on\nthe shell. I tried it out on bash though forgot to mention it. Thanks\nfor the help!\n\nRegards,\nPranit Bauva\n"}]}