{"thread":{"id":"35733","subject":"[PATCH] tree_entry_interesting: match against all pathspecs","startedAt":"2014-01-25T22:06:46Z","lastAt":"2014-01-27T16:57:40Z","messageCount":3,"participants":["Andy Spencer","Duy Nguyen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"233758","messageId":"20140125220646.GA24370@pileus.org","threadId":"35733","inReplyTo":null,"subject":"[PATCH] tree_entry_interesting: match against all pathspecs","fromName":"Andy Spencer","fromEmail":"andy753421@gmail.com","sentAt":"2014-01-25T22:06:46Z","receivedAt":"2014-01-25T22:06:46Z","isPatch":true,"sender":{"key":"andy753421@gmail.com","avatar":null},"body":"The current basedir compare aborts early in order to avoid futile\nrecursive searches. However, a match may still be found by another\npathspec. This can cause an error while checking out files from a branch\nwhen using multiple pathspecs:\n\n$ git checkout master -- 'a/*.txt' 'b/*.txt'\nerror: pathspec 'a/*.txt' did not match any file(s) known to git.\n\nSigned-off-by: Andy Spencer <andy753421@gmail.com>\n---\n tree-walk.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/tree-walk.c b/tree-walk.c\nindex 5ece8c3..e06f240 100644\n--- a/tree-walk.c\n+++ b/tree-walk.c\n@@ -743,7 +743,7 @@ match_wildcards:\n \n \t\tif (item->nowildcard_len &&\n \t\t    !match_wildcard_base(item, base_str, baselen, &matched))\n-\t\t\treturn entry_not_interesting;\n+\t\t\tcontinue;\n \n \t\t/*\n \t\t * Concatenate base and entry->path into one and do\n-- \n1.8.5.3\n"},{"id":"233760","messageId":"20140125224833.GA19549@lanh","threadId":"35733","inReplyTo":"20140125220646.GA24370@pileus.org","subject":"Re: [PATCH] tree_entry_interesting: match against all pathspecs","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-01-25T22:48:33Z","receivedAt":"2014-01-25T22:48:33Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Jan 25, 2014 at 10:06:46PM +0000, Andy Spencer wrote:\n> The current basedir compare aborts early in order to avoid futile\n> recursive searches. However, a match may still be found by another\n> pathspec. This can cause an error while checking out files from a branch\n> when using multiple pathspecs:\n> \n> $ git checkout master -- 'a/*.txt' 'b/*.txt'\n> error: pathspec 'a/*.txt' did not match any file(s) known to git.\n> \n> Signed-off-by: Andy Spencer <andy753421@gmail.com>\n> ---\n>  tree-walk.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/tree-walk.c b/tree-walk.c\n> index 5ece8c3..e06f240 100644\n> --- a/tree-walk.c\n> +++ b/tree-walk.c\n> @@ -743,7 +743,7 @@ match_wildcards:\n>  \n>  \t\tif (item->nowildcard_len &&\n>  \t\t    !match_wildcard_base(item, base_str, baselen, &matched))\n> -\t\t\treturn entry_not_interesting;\n> +\t\t\tcontinue;\n>  \n>  \t\t/*\n>  \t\t * Concatenate base and entry->path into one and do\n\nAck. Perhaps this on top to verify it\n\n-- 8< --\ndiff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\nindex af5134b..d9f37c3 100755\n--- a/t/t4010-diff-pathspec.sh\n+++ b/t/t4010-diff-pathspec.sh\n@@ -110,4 +110,17 @@ test_expect_success 'diff-tree -r with wildcard' '\n \ttest_cmp expected result\n '\n \n+test_expect_success 'diff multiple wildcard pathspecs' '\n+\tmkdir path2 &&\n+\techo rezrov >path2/file1 &&\n+\tgit update-index --add path2/file1 &&\n+\ttree3=`git write-tree` &&\n+\tgit diff --name-only $tree $tree3 -- \"path2*1\" \"path1*1\" >actual &&\n+\tcat <<EOF >expect &&\n+path1/file1\n+path2/file1\n+EOF\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- 8< --\n"},{"id":"233831","messageId":"xmqq4n4ppdkr.fsf@gitster.dls.corp.google.com","threadId":"35733","inReplyTo":"20140125224833.GA19549@lanh","subject":"Re: [PATCH] tree_entry_interesting: match against all pathspecs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-27T16:57:40Z","receivedAt":"2014-01-27T16:57:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> Ack. Perhaps this on top to verify it\n>\n> -- 8< --\n> diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh\n> index af5134b..d9f37c3 100755\n> --- a/t/t4010-diff-pathspec.sh\n> +++ b/t/t4010-diff-pathspec.sh\n> @@ -110,4 +110,17 @@ test_expect_success 'diff-tree -r with wildcard' '\n>  \ttest_cmp expected result\n>  '\n>  \n> +test_expect_success 'diff multiple wildcard pathspecs' '\n> +\tmkdir path2 &&\n> +\techo rezrov >path2/file1 &&\n> +\tgit update-index --add path2/file1 &&\n> +\ttree3=`git write-tree` &&\n> +\tgit diff --name-only $tree $tree3 -- \"path2*1\" \"path1*1\" >actual &&\n> +\tcat <<EOF >expect &&\n> +path1/file1\n> +path2/file1\n> +EOF\n> +\ttest_cmp expect actual\n> +'\n> +\n>  test_done\n> -- 8< --\n\nThanks, both.  Will queue.\n"}]}