{"thread":{"id":"41826","subject":"[PATCH] t7012: Implement test for git-checkout","startedAt":"2016-03-25T17:36:20Z","lastAt":"2016-03-25T23:29:06Z","messageCount":3,"participants":["Chhatoi Pritam Baral","Torsten Bögershausen","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"281837","messageId":"56F57714.4050708@gmail.com","threadId":"41826","inReplyTo":null,"subject":"[PATCH] t7012: Implement test for git-checkout","fromName":"Chhatoi Pritam Baral","fromEmail":"chhatoipritam@gmail.com","sentAt":"2016-03-25T17:36:20Z","receivedAt":"2016-03-25T17:36:20Z","isPatch":true,"sender":{"key":"chhatoipritam@gmail.com","avatar":"https://gravatar.com/avatar/2c5ac133640a20922f83e09e7b146a5cd5ad2472ee325969573401c048e78cbd?d=mp&s=160"},"body":"Previously a TODO, this patch adds a test for git-checkout skipping a\nfile with the\nskip-worktree bit set.\n\nI'm doing this as a microproject for my GSoC '16 application.\n\nSigned-off-by: Chhatoi Pritam Baral <chhatoipritam@gmail.com>\n---\n t/t7012-skip-worktree-writing.sh | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7012-skip-worktree-writing.sh\nb/t/t7012-skip-worktree-writing.sh\nindex 9ceaa40..d5b42d6 100755\n--- a/t/t7012-skip-worktree-writing.sh\n+++ b/t/t7012-skip-worktree-writing.sh\n@@ -141,6 +141,16 @@ test_expect_success 'git-clean, dirty case' '\n #TODO test_expect_failure 'git-apply removes file' false\n #TODO test_expect_failure 'git-mv to skip-worktree' false\n #TODO test_expect_failure 'git-mv from skip-worktree' false\n-#TODO test_expect_failure 'git-checkout' false\n+\n+test_expect_success 'git-checkout ignores skip-worktree file' '\n+\techo > 1 &&\n+\tgit commit -m \"Add files\" &&\n+\techo dirty > 1 &&\n+\techo dirty > 2 &&\n+\tgit update-index --skip-worktree 1 &&\n+\tgit checkout -- . &&\n+\tgrep -q dirty 1 &&\n+\ttest_must_fail grep -q dirty 2\n+'\n  test_done\n-- \n2.7.4\n"},{"id":"281882","messageId":"56F5BC94.1070903@web.de","threadId":"41826","inReplyTo":"56F57714.4050708@gmail.com","subject":"Re: [PATCH] t7012: Implement test for git-checkout","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-25T22:32:52Z","receivedAt":"2016-03-25T22:32:52Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2016-03-25 18.36, Chhatoi Pritam Baral wrote:\nThanks for working on Git.\nSome comments inline.\n> Previously a TODO, this patch adds a test for git-checkout skipping a\n> file with the\n> skip-worktree bit set.\nMicro-nit: the \"this patch ...\" may be written shorter:\n> Previously a TODO, add a test for git-checkout skipping a\n> file with the skip-worktree bit set.\n\n> \n> I'm doing this as a microproject for my GSoC '16 application.\nThis info is good to have, but doesn't need to stay forever in the\ncommit message. It may be below (see XXX)\n> \n> Signed-off-by: Chhatoi Pritam Baral <chhatoipritam@gmail.com>\n> ---\nXXX Add additional info here.\n>  t/t7012-skip-worktree-writing.sh | 11 ++++++++++-\n>  1 file changed, 10 insertions(+), 1 deletion(-)\n> \n> diff --git a/t/t7012-skip-worktree-writing.sh\n> b/t/t7012-skip-worktree-writing.sh\n> index 9ceaa40..d5b42d6 100755\n> --- a/t/t7012-skip-worktree-writing.sh\n> +++ b/t/t7012-skip-worktree-writing.sh\n> @@ -141,6 +141,16 @@ test_expect_success 'git-clean, dirty case' '\n>  #TODO test_expect_failure 'git-apply removes file' false\n>  #TODO test_expect_failure 'git-mv to skip-worktree' false\n>  #TODO test_expect_failure 'git-mv from skip-worktree' false\n> -#TODO test_expect_failure 'git-checkout' false\n> +\n> +test_expect_success 'git-checkout ignores skip-worktree file' '\n> +\techo > 1 &&\nStyle: No space after the '>', like this:\necho >1 &&\n\n> +\tgit commit -m \"Add files\" &&\n> +\techo dirty > 1 &&\n> +\techo dirty > 2 &&\n> +\tgit update-index --skip-worktree 1 &&\n> +\tgit checkout -- . &&\n> +\tgrep -q dirty 1 &&\n> +\ttest_must_fail grep -q dirty 2\n> +'\n>   test_done\n> \n"},{"id":"281894","messageId":"CAPig+cR16EOA-EC=6GXXAkoJRC7dP-79xJUjVhyg+62sukK6qg@mail.gmail.com","threadId":"41826","inReplyTo":"56F57714.4050708@gmail.com","subject":"Re: [PATCH] t7012: Implement test for git-checkout","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-03-25T23:29:06Z","receivedAt":"2016-03-25T23:29:06Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Mar 25, 2016 at 1:36 PM, Chhatoi Pritam Baral\n<chhatoipritam@gmail.com> wrote:\n> Previously a TODO, this patch adds a test for git-checkout skipping a\n> file with the skip-worktree bit set.\n\nIn addition to Torsten's comments...\n\n> diff --git a/t/t7012-skip-worktree-writing.sh\n> b/t/t7012-skip-worktree-writing.sh\n> @@ -141,6 +141,16 @@ test_expect_success 'git-clean, dirty case' '\n>  #TODO test_expect_failure 'git-apply removes file' false\n>  #TODO test_expect_failure 'git-mv to skip-worktree' false\n>  #TODO test_expect_failure 'git-mv from skip-worktree' false\n> -#TODO test_expect_failure 'git-checkout' false\n> +\n> +test_expect_success 'git-checkout ignores skip-worktree file' '\n> +       echo > 1 &&\n> +       git commit -m \"Add files\" &&\n> +       echo dirty > 1 &&\n> +       echo dirty > 2 &&\n> +       git update-index --skip-worktree 1 &&\n> +       git checkout -- . &&\n> +       grep -q dirty 1 &&\n> +       test_must_fail grep -q dirty 2\n\ntest_must_fail is for git commands; for system commands, just use '!'\n(t/README explains the rationale).\n\n    ! grep -q dirty 2\n\n> +'\n>   test_done\n"}]}