{"thread":{"id":"37986","subject":"Doing a git add '' will add more files then expected","startedAt":"2014-11-17T16:25:10Z","lastAt":"2014-11-23T19:06:23Z","messageCount":5,"participants":["Guilherme","Andreas Schwab","Matthieu Moy","Junio C Hamano","Javier Domingo Cansino"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251986","messageId":"CAMDzUtyhNKdzHQK2zLEutJRcRUibhO-U6Zh0yJhrx-YxBqP5cQ@mail.gmail.com","threadId":"37986","inReplyTo":null,"subject":"Doing a git add '' will add more files then expected","fromName":"Guilherme","fromEmail":"guibufolo@gmail.com","sentAt":"2014-11-17T16:25:10Z","receivedAt":"2014-11-17T16:25:10Z","isPatch":false,"sender":{"key":"guibufolo@gmail.com","avatar":null},"body":"Hello,\n\nI first asked on stackoverflow\n(http://stackoverflow.com/questions/26933761/python-sh-module-and-git-try-to-add-more-files-then-in-command/26934517#26934517)\nabout this behaviour.\n\nThen on the conversation that happened on the git-users mailing list\nother agreed that this behaviour is probably not as intended.\n\nSteps to reproduce:\nIn bash (not sure this is bash specific) do:\ngit add ''\n(that's to apostrophes, an empty argument)\n\nResults\nsame as doing git add .\n\nExpected\nno files added or error about not finding file ''\n\nHope this helps.\nGuilherme\n"},{"id":"251992","messageId":"87lhn91ynu.fsf@igel.home","threadId":"37986","inReplyTo":"CAMDzUtyhNKdzHQK2zLEutJRcRUibhO-U6Zh0yJhrx-YxBqP5cQ@mail.gmail.com","subject":"Re: Doing a git add '' will add more files then expected","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-11-17T18:15:33Z","receivedAt":"2014-11-17T18:15:33Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Guilherme <guibufolo@gmail.com> writes:\n\n> Steps to reproduce:\n> In bash (not sure this is bash specific) do:\n> git add ''\n> (that's to apostrophes, an empty argument)\n>\n> Results\n> same as doing git add .\n>\n> Expected\n> no files added or error about not finding file ''\n\nThe argument to git add is a pathspec, and the empty pathspec matches\nall files.\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":"251993","messageId":"vpqa93p8y9n.fsf@anie.imag.fr","threadId":"37986","inReplyTo":"87lhn91ynu.fsf@igel.home","subject":"Re: Doing a git add '' will add more files then expected","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-11-17T18:42:12Z","receivedAt":"2014-11-17T18:42:12Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> The argument to git add is a pathspec, and the empty pathspec matches\n> all files.\n\nErr, why does the empty pathspec match all files? Isn't that a bug?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"251997","messageId":"xmqqh9xxy79x.fsf@gitster.dls.corp.google.com","threadId":"37986","inReplyTo":"vpqa93p8y9n.fsf@anie.imag.fr","subject":"Re: Doing a git add '' will add more files then expected","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-17T19:08:26Z","receivedAt":"2014-11-17T19:08:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Andreas Schwab <schwab@linux-m68k.org> writes:\n>\n>> The argument to git add is a pathspec, and the empty pathspec matches\n>> all files.\n>\n> Err, why does the empty pathspec match all files? Isn't that a bug?\n\nThat is debatable.\n\n    cd Documentation\n    git add \"a\"\n\nwould be equivalent to typing\n\n    git add Documentation/\"a\"\n\nso\n\n    cd Documentation\n    git add \"\"\n\nwould be equivalent to typing\n\n    git add Documentation/\"\"\n\nAnd doing the same from the top-level of the working tree can be\nargued to be a natural extension.\n"},{"id":"252401","messageId":"CALZVapkKFOSQptQX2_A5E9Oankk+ZBQYcALNW0OTzu4aARJx2g@mail.gmail.com","threadId":"37986","inReplyTo":"xmqqh9xxy79x.fsf@gitster.dls.corp.google.com","subject":"Re: Doing a git add '' will add more files then expected","fromName":"Javier Domingo Cansino","fromEmail":"javierdo1@gmail.com","sentAt":"2014-11-23T19:06:23Z","receivedAt":"2014-11-23T19:06:23Z","isPatch":false,"sender":{"key":"javierdo1@gmail.com","avatar":"https://gravatar.com/avatar/0f43d4d2e5f4320e8b5e1a46914213c5459dd0de261ab1587f222827f863d727?d=mp&s=160"},"body":"IMO, if you put an empty string \"\" you would be implying the same as\nwith a dot (git add . ).\n\nThe important thing is that \"git add\" without a pathspec returns an\nerror, as it has always done, mainly because it people tend to work\nwithout gitignoring all the files they should, and allowing such\nbehaviour would make things harder.\n\n-- \nJavier Domingo Cansino\n"}]}