{"thread":{"id":"20975","subject":"Behavior of 'git add \\*.txt': bug or feature?","startedAt":"2009-09-16T19:46:51Z","lastAt":"2009-09-17T14:25:26Z","messageCount":4,"participants":["Matthieu Moy","Junio C Hamano","Clemens Buchacher"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"123367","messageId":"vpqljke7jv8.fsf@bauges.imag.fr","threadId":"20975","inReplyTo":null,"subject":"Behavior of 'git add \\*.txt': bug or feature?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-09-16T19:46:51Z","receivedAt":"2009-09-16T19:46:51Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Hi,\n\nI find the behavior of 'git add \\*.txt' strange: for adding untracked\nfiles, it considers \\*.txt as a pattern to match, but for updating\nexisting file's staged content, it seems to consider it as a filename:\n\n$ git status\n# On branch master\n# Changed but not updated:\n#\n#       modified:   three.txt\n#       modified:   two.txt\n#\n# Untracked files:\n#\n#       one.txt\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n$ git add -v '*.txt'\nadd 'one.txt'\n$ git add -v '*.txt'\n$ \n\nI would have expected this \"git add -v '*.txt'\" to update the staged\ncontent of two.txt and three.txt too.\n\nIt this the intended behavior? If so, what's the rationale for this?\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"123370","messageId":"7vbplazl7s.fsf@alter.siamese.dyndns.org","threadId":"20975","inReplyTo":"vpqljke7jv8.fsf@bauges.imag.fr","subject":"Re: Behavior of 'git add \\*.txt': bug or feature?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-09-16T20:30:15Z","receivedAt":"2009-09-16T20:30:15Z","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> It this the intended behavior? If so, what's the rationale for this?\n\nI strongly suspect that it comes from the fact that we have two\ndefinitions and three implementations of pathspec-aware tree traversal.\nOne family is unaware of shell-glob wildcards (they only do leading\ndirectory path match) while the other know both leading directory path and\nshell-glob.\n\nIt is on the list of long-term items to fix, as the change required is\nquite involved.\n"},{"id":"123373","messageId":"vpqr5u637kb.fsf@bauges.imag.fr","threadId":"20975","inReplyTo":"7vbplazl7s.fsf@alter.siamese.dyndns.org","subject":"Re: Behavior of 'git add \\*.txt': bug or feature?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-09-16T21:26:12Z","receivedAt":"2009-09-16T21:26:12Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> It this the intended behavior? If so, what's the rationale for this?\n>\n> I strongly suspect that it comes from the fact that we have two\n> definitions and three implementations of pathspec-aware tree traversal.\n> One family is unaware of shell-glob wildcards (they only do leading\n> directory path match) while the other know both leading directory path and\n> shell-glob.\n>\n> It is on the list of long-term items to fix, as the change required is\n> quite involved.\n\nOK, that answers my question.\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"123453","messageId":"20090917142526.GA28878@localhost","threadId":"20975","inReplyTo":"7vbplazl7s.fsf@alter.siamese.dyndns.org","subject":"Re: Behavior of 'git add \\*.txt': bug or feature?","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-09-17T14:25:26Z","receivedAt":"2009-09-17T14:25:26Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Wed, Sep 16, 2009 at 01:30:15PM -0700, Junio C Hamano wrote:\n\n> I strongly suspect that it comes from the fact that we have two\n> definitions and three implementations of pathspec-aware tree traversal.\n> One family is unaware of shell-glob wildcards (they only do leading\n> directory path match) while the other know both leading directory path and\n> shell-glob.\n\nWe had a discussion about this in January:\n\n\tSubject: Re: [PATCH 3/3] implement pattern matching in ce_path_match\n\tMessage-ID: <7vljtd20m6.fsf@gitster.siamese.dyndns.org>\n\thttp://article.gmane.org/gmane.comp.version-control.git/105679\n\nI was going to fix it, but motivation left me after the above discussion,\nsince I don't really care about this feature.\n\nClemens\n"}]}