{"thread":{"id":"2997","subject":"[PATCH 1/7] Add a minimal test for git-cherry","startedAt":"2006-01-08T00:38:15Z","lastAt":"2006-01-08T09:58:44Z","messageCount":3,"participants":["Yann Dirson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"14276","messageId":"20060108003815.GI1113@nowhere.earth","threadId":"2997","inReplyTo":null,"subject":"[PATCH 1/7] Add a minimal test for git-cherry","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-01-08T00:38:15Z","receivedAt":"2006-01-08T00:38:15Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"This test checks that git-cherry finds the expected number of patches\nin two simple cases.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n\n\n---\n\n t/t3500-cherry.sh |   47 +++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 47 insertions(+), 0 deletions(-)\n create mode 100755 t/t3500-cherry.sh\n\ne9d999acb2653af449e3122872cbd4e8f8260c71\ndiff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh\nnew file mode 100755\nindex 0000000..f2f9109\n--- /dev/null\n+++ b/t/t3500-cherry.sh\n@@ -0,0 +1,47 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland\n+#\n+\n+test_description='git-cherry should detect patches integrated upstream\n+\n+This test cherry-picks one local change of two into master branch, and\n+checks that git-cherry only returns the second patch in the local branch\n+'\n+. ./test-lib.sh\n+\n+export GIT_AUTHOR_EMAIL=bogus_email_address\n+\n+test_expect_success \\\n+    'prepare repository with topic branch, and check cherry finds the 2 patches from there' \\\n+    'echo First > A &&\n+     git-update-index --add A &&\n+     git-commit -m \"Add A.\" &&\n+\n+     git-checkout -b my-topic-branch &&\n+\n+     echo Second > B &&\n+     git-update-index --add B &&\n+     git-commit -m \"Add B.\" &&\n+\n+     echo AnotherSecond > C &&\n+     git-update-index --add C &&\n+     git-commit -m \"Add C.\" &&\n+\n+     git-checkout -f master &&\n+\n+     echo Third >> A &&\n+     git-update-index A &&\n+     git-commit -m \"Modify A.\" &&\n+\n+     expr \"$(echo $(git-cherry master my-topic-branch) )\" : \"+ [^ ]* + .*\"\n+'\n+\n+test_expect_success \\\n+    'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \\\n+    'git-cherry-pick my-topic-branch^0 &&\n+     echo $(git-cherry master my-topic-branch) &&\n+     expr \"$(echo $(git-cherry master my-topic-branch) )\" : \"+ [^ ]* - .*\"\n+'\n+\n+test_done\n-- \n1.0.6-g8ecb\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"14291","messageId":"7vy81r5ugx.fsf@assigned-by-dhcp.cox.net","threadId":"2997","inReplyTo":"20060108003815.GI1113@nowhere.earth","subject":"Re: [PATCH 1/7] Add a minimal test for git-cherry","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-08T02:22:54Z","receivedAt":"2006-01-08T02:22:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> This test checks that git-cherry finds the expected number of patches\n> in two simple cases.\n>\n> Signed-off-by: Yann Dirson <ydirson@altern.org>\n>\n> +test_expect_success \\\n> +    'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \\\n> +    'git-cherry-pick my-topic-branch^0 &&\n> +     echo $(git-cherry master my-topic-branch) &&\n> +     expr \"$(echo $(git-cherry master my-topic-branch) )\" : \"+ [^ ]* - .*\"\n> +'\n\nI wonder if \"+ followed by -\" order is stable here.  If you make\ncommits in the my-topic-branch fast enough, they would get the\nsame timestamp and I suspect the order from rev-list would be\nleft to chance.\n"},{"id":"14300","messageId":"20060108095843.GD32585@nowhere.earth","threadId":"2997","inReplyTo":"7vy81r5ugx.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/7] Add a minimal test for git-cherry","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-01-08T09:58:44Z","receivedAt":"2006-01-08T09:58:44Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Sat, Jan 07, 2006 at 06:22:54PM -0800, Junio C Hamano wrote:\n> Yann Dirson <ydirson@altern.org> writes:\n> \n> > This test checks that git-cherry finds the expected number of patches\n> > in two simple cases.\n> >\n> > Signed-off-by: Yann Dirson <ydirson@altern.org>\n> >\n> > +test_expect_success \\\n> > +    'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \\\n> > +    'git-cherry-pick my-topic-branch^0 &&\n> > +     echo $(git-cherry master my-topic-branch) &&\n> > +     expr \"$(echo $(git-cherry master my-topic-branch) )\" : \"+ [^ ]* - .*\"\n> > +'\n> \n> I wonder if \"+ followed by -\" order is stable here.  If you make\n> commits in the my-topic-branch fast enough, they would get the\n> same timestamp and I suspect the order from rev-list would be\n> left to chance.\n\nWe could maybe insert a sleep between the two commits ?  Not that I\nfind it too appealing, however...\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"}]}