{"thread":{"id":"12299","subject":"[PATCH 0/2] test send-email --compose","startedAt":"2008-02-24T20:57:21Z","lastAt":"2008-02-24T21:04:14Z","messageCount":3,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"69817","messageId":"20080224205720.GA7085@coredump.intra.peff.net","threadId":"12299","inReplyTo":null,"subject":"[PATCH 0/2] test send-email --compose","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-02-24T20:57:21Z","receivedAt":"2008-02-24T20:57:21Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This is a respun version of some tests from the freeze period. The bug\nthey test for was fixed, but these weren't accepted because there was a\nmodification to git-send-email.perl (a --no-confirm-send option) that we\ndidn't want during the freeze.\n\nNot only are we now out of freeze, but we recently added a\nGIT_SEND_EMAIL_NOTTY flag which accomplishes a similar goal for testing.\nThis version is updated to use that flag and drops the --no-confirm-send\noption entirely.\n\n-Peff\n"},{"id":"69819","messageId":"20080224210352.GA9150@coredump.intra.peff.net","threadId":"12299","inReplyTo":"20080224205720.GA7085@coredump.intra.peff.net","subject":"[PATCH] t9001: enhance fake sendmail test harness","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-02-24T21:03:52Z","receivedAt":"2008-02-24T21:03:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Previously, the fake.sendmail test harness would write its\noutput to a hardcoded file, allowing only a single message\nto be tested. Instead, let's have it save the messages for\nall of its invocations so that we can see which messages\nwere sent, and in which order.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t9001-send-email.sh |   22 +++++++++++++++-------\n 1 files changed, 15 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 2efaed4..4975048 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -15,16 +15,22 @@ test_expect_success \\\n     'Setup helper tool' \\\n     '(echo \"#!/bin/sh\"\n       echo shift\n+      echo output=1\n+      echo \"while test -f commandline\\$output; do output=\\$((\\$output+1)); done\"\n       echo for a\n       echo do\n       echo \"  echo \\\"!\\$a!\\\"\"\n-      echo \"done >commandline\"\n-      echo \"cat > msgtxt\"\n+      echo \"done >commandline\\$output\"\n+      echo \"cat > msgtxt\\$output\"\n       ) >fake.sendmail &&\n      chmod +x ./fake.sendmail &&\n      git add fake.sendmail &&\n      GIT_AUTHOR_NAME=\"A\" git commit -a -m \"Second.\"'\n \n+clean_fake_sendmail() {\n+\trm -f commandline* msgtxt*\n+}\n+\n test_expect_success 'Extract patches' '\n     patches=`git format-patch -n HEAD^1`\n '\n@@ -39,7 +45,7 @@ cat >expected <<\\EOF\n EOF\n test_expect_success \\\n     'Verify commandline' \\\n-    'diff commandline expected'\n+    'diff commandline1 expected'\n \n cat >expected-show-all-headers <<\\EOF\n 0001-Second.patch\n@@ -82,7 +88,7 @@ z8=zzzzzzzz\n z64=$z8$z8$z8$z8$z8$z8$z8$z8\n z512=$z64$z64$z64$z64$z64$z64$z64$z64\n test_expect_success 'reject long lines' '\n-\trm -f commandline &&\n+\tclean_fake_sendmail &&\n \tcp $patches longline.patch &&\n \techo $z512$z512 >>longline.patch &&\n \t! git send-email \\\n@@ -95,7 +101,7 @@ test_expect_success 'reject long lines' '\n '\n \n test_expect_success 'no patch was sent' '\n-\t! test -e commandline\n+\t! test -e commandline1\n '\n \n test_expect_success 'allow long lines with --no-validate' '\n@@ -109,6 +115,7 @@ test_expect_success 'allow long lines with --no-validate' '\n '\n \n test_expect_success 'Invalid In-Reply-To' '\n+\tclean_fake_sendmail &&\n \tgit send-email \\\n \t\t--from=\"Example <nobody@example.com>\" \\\n \t\t--to=nobody@example.com \\\n@@ -116,17 +123,18 @@ test_expect_success 'Invalid In-Reply-To' '\n \t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t$patches\n \t\t2>errors\n-\t! grep \"^In-Reply-To: < *>\" msgtxt\n+\t! grep \"^In-Reply-To: < *>\" msgtxt1\n '\n \n test_expect_success 'Valid In-Reply-To when prompting' '\n+\tclean_fake_sendmail &&\n \t(echo \"From Example <from@example.com>\"\n \t echo \"To Example <to@example.com>\"\n \t echo \"\"\n \t) | env GIT_SEND_EMAIL_NOTTY=1 git send-email \\\n \t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t$patches 2>errors &&\n-\t! grep \"^In-Reply-To: < *>\" msgtxt\n+\t! grep \"^In-Reply-To: < *>\" msgtxt1\n '\n \n test_done\n-- \n1.5.4.3.307.gacd7\n"},{"id":"69820","messageId":"20080224210414.GB9150@coredump.intra.peff.net","threadId":"12299","inReplyTo":"20080224205720.GA7085@coredump.intra.peff.net","subject":"[PATCH 2/2] send-email: test compose functionality","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-02-24T21:04:14Z","receivedAt":"2008-02-24T21:04:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This is just a basic sanity check that --compose works at\nall.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t9001-send-email.sh |   29 +++++++++++++++++++++++++++++\n 1 files changed, 29 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 4975048..cbbfa9c 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -137,4 +137,33 @@ test_expect_success 'Valid In-Reply-To when prompting' '\n \t! grep \"^In-Reply-To: < *>\" msgtxt1\n '\n \n+test_expect_success 'setup fake editor' '\n+\t(echo \"#!/bin/sh\" &&\n+\t echo \"echo fake edit >>\\$1\"\n+\t) >fake-editor &&\n+\tchmod +x fake-editor\n+'\n+\n+test_expect_success '--compose works' '\n+\tclean_fake_sendmail &&\n+\techo y | \\\n+\t\tGIT_EDITOR=$(pwd)/fake-editor \\\n+\t\tGIT_SEND_EMAIL_NOTTY=1 \\\n+\t\tgit send-email \\\n+\t\t--compose --subject foo \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--to=nobody@example.com \\\n+\t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n+\t\t$patches \\\n+\t\t2>errors\n+'\n+\n+test_expect_success 'first message is compose text' '\n+\tgrep \"^fake edit\" msgtxt1\n+'\n+\n+test_expect_success 'second message is patch' '\n+\tgrep \"Subject:.*Second\" msgtxt2\n+'\n+\n test_done\n-- \n1.5.4.3.307.gacd7\n"}]}