{"thread":{"id":"11694","subject":"git-send-email not sending?","startedAt":"2008-01-21T18:30:11Z","lastAt":"2008-01-22T03:29:05Z","messageCount":8,"participants":["Seth Falcon","Gustaf Hendeby","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66162","messageId":"m2y7aj9glo.fsf@userprimary.net","threadId":"11694","inReplyTo":null,"subject":"git-send-email not sending?","fromName":"Seth Falcon","fromEmail":"seth@userprimary.net","sentAt":"2008-01-21T18:30:11Z","receivedAt":"2008-01-21T18:30:11Z","isPatch":false,"sender":{"key":"seth@userprimary.net","avatar":"https://gravatar.com/avatar/1db807504c1f8fb0a13bf1056a1e4d5096d17f3a09a1e9540f3af5f8b5ee009c?d=mp&s=160"},"body":"Hi,\n\nI'm using git version 1.5.4.rc3.37.gfdcf3 and when I use\ngit-send-email with the --compose option like this:\n\n   git send-email --compose -- a_dir_of_patches/\n\nThe intro email gets sent, but not any of the actual patches.  If I\nommit the --compose option, then the patches do get sent.  Pretty sure\nthis worked for me until a recent update so I wonder if there's a\nbuglet in the recent validation patches (or I'm in error and missing\nsome needed config?).\n\n+ seth\n\n-- \nSeth Falcon | seth@userprimary.net | blog: http://userprimary.net/user/\n"},{"id":"66178","messageId":"1200945466-21154-1-git-send-email-hendeby@isy.liu.se","threadId":"11694","inReplyTo":"m2y7aj9glo.fsf@userprimary.net","subject":"Test of send-email patch","fromName":"Gustaf Hendeby","fromEmail":"hendeby@isy.liu.se","sentAt":"2008-01-21T19:57:45Z","receivedAt":"2008-01-21T19:57:45Z","isPatch":false,"sender":{"key":"hendeby@isy.liu.se","avatar":"https://avatars.githubusercontent.com/u/730316?v=4"},"body":"This email is sent with git send-email --compose to verify that the\npatch following in the next mail fixes the problem reported by Seth.\n\n/Gustaf\n"},{"id":"66179","messageId":"1200945466-21154-2-git-send-email-hendeby@isy.liu.se","threadId":"11694","inReplyTo":"1200945466-21154-1-git-send-email-hendeby@isy.liu.se","subject":"[PATCH] send-email, fix breakage in combination with --compose","fromName":"Gustaf Hendeby","fromEmail":"hendeby@isy.liu.se","sentAt":"2008-01-21T19:57:46Z","receivedAt":"2008-01-21T19:57:46Z","isPatch":true,"sender":{"key":"hendeby@isy.liu.se","avatar":"https://avatars.githubusercontent.com/u/730316?v=4"},"body":"This fixes the subtile bug in git send-email that was introduced into\ngit send-email with\n\ncommit aa54892f5ada8282643dc7387b33261c7135d784\nsend-email: detect invocation errors earlier\n\ncausing no patches to be sent out if the --compose flag was used.\n\nSigned-off-by: Gustaf Hendeby <hendeby@isy.liu.se>\n---\n git-send-email.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 6c72952..a1a9d14 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -462,7 +462,7 @@ EOT\n \t\texit(0);\n \t}\n \n-\t@files = ($compose_filename . \".final\");\n+\t@files = ($compose_filename . \".final\", @files);\n }\n \n # Variables we set as part of the loop over files\n-- \n1.5.4.rc4.1.gbdcdb\n"},{"id":"66233","messageId":"m23asqafnm.fsf@userprimary.net","threadId":"11694","inReplyTo":"1200945466-21154-2-git-send-email-hendeby@isy.liu.se","subject":"Re: [PATCH] send-email, fix breakage in combination with --compose","fromName":"Seth Falcon","fromEmail":"seth@userprimary.net","sentAt":"2008-01-22T00:05:17Z","receivedAt":"2008-01-22T00:05:17Z","isPatch":true,"sender":{"key":"seth@userprimary.net","avatar":"https://gravatar.com/avatar/1db807504c1f8fb0a13bf1056a1e4d5096d17f3a09a1e9540f3af5f8b5ee009c?d=mp&s=160"},"body":"Hi Gustaf,\n\nGustaf Hendeby <hendeby@isy.liu.se> writes:\n> This fixes the subtile bug in git send-email that was introduced into\n> git send-email with\n>\n> commit aa54892f5ada8282643dc7387b33261c7135d784\n> send-email: detect invocation errors earlier\n>\n> causing no patches to be sent out if the --compose flag was used.\n>\n> Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>\n\nI gave this a quick test and it works for me too.  Thanks!\n\nSo FWIW,\n\nAcked-by: Seth Falcon <seth@userprimary.net>\n\n-- \nSeth Falcon | seth@userprimary.net | blog: http://userprimary.net/user/\n"},{"id":"66265","messageId":"20080122031932.GA24758@coredump.intra.peff.net","threadId":"11694","inReplyTo":"1200945466-21154-2-git-send-email-hendeby@isy.liu.se","subject":"Re: [PATCH] send-email, fix breakage in combination with --compose","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-22T03:19:32Z","receivedAt":"2008-01-22T03:19:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jan 21, 2008 at 08:57:46PM +0100, Gustaf Hendeby wrote:\n\n> This fixes the subtile bug in git send-email that was introduced into\n> git send-email with\n> \n> commit aa54892f5ada8282643dc7387b33261c7135d784\n> send-email: detect invocation errors earlier\n\nSorry, this was my fault. I have looked over the code again to make sure\nthere are not any other places where the movement of @files should\nmatter, but this seems to be the only one.\n\nAs penance, I'll send some tests in a moment.\n\n> -\t@files = ($compose_filename . \".final\");\n> +\t@files = ($compose_filename . \".final\", @files);\n\nI think this might be more readable as\n\n  unshift @files, \"$compose_filename.final\";\n\nbut either way it fixes the bug, so\n\nAcked-by: Jeff King <peff@peff.net>\n\n-Peff\n"},{"id":"66267","messageId":"20080122032353.GB24758@coredump.intra.peff.net","threadId":"11694","inReplyTo":"20080122031932.GA24758@coredump.intra.peff.net","subject":"[PATCH 1/3] t9001: add missing && operators","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-22T03:23:53Z","receivedAt":"2008-01-22T03:23:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"\nThe exit value of some commands was not being used for the\ntest output.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nOn Mon, Jan 21, 2008 at 10:19:32PM -0500, Jeff King wrote:\n\n> As penance, I'll send some tests in a moment.\n\nThis turned into a 3-patch series because of some cleanup needed. This\nfirst one is just tightening up the setup tests, which will be modified\nin the next patch.\n\n t/t9001-send-email.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 4f6822f..08f7c3d 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -8,7 +8,7 @@ test_expect_success \\\n     'prepare reference tree' \\\n     'echo \"1A quick brown fox jumps over the\" >file &&\n      echo \"lazy dog\" >>file &&\n-     git add file\n+     git add file &&\n      GIT_AUTHOR_NAME=\"A\" git commit -a -m \"Initial.\"'\n \n test_expect_success \\\n@@ -20,9 +20,9 @@ test_expect_success \\\n       echo \"  echo \\\"!\\$a!\\\"\"\n       echo \"done >commandline\"\n       echo \"cat > msgtxt\"\n-      ) >fake.sendmail\n-     chmod +x ./fake.sendmail\n-     git add fake.sendmail\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 test_expect_success 'Extract patches' '\n-- \n1.5.4.rc3.1130.gd9718-dirty\n"},{"id":"66268","messageId":"20080122032544.GC24758@coredump.intra.peff.net","threadId":"11694","inReplyTo":"20080122032353.GB24758@coredump.intra.peff.net","subject":"[PATCH 2/3] t9001: enhance fake sendmail test harness","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-22T03:25:44Z","receivedAt":"2008-01-22T03:25:44Z","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\nwhich were sent, and in which order.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis shouldn't change the test behavior at all, but is needed for the\ntest in 3/3.\n\n t/t9001-send-email.sh |   16 +++++++++++-----\n 1 files changed, 11 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 08f7c3d..dd0c395 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 -e 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-- \n1.5.4.rc3.1130.gd9718-dirty\n"},{"id":"66269","messageId":"20080122032905.GD24758@coredump.intra.peff.net","threadId":"11694","inReplyTo":"20080122032544.GC24758@coredump.intra.peff.net","subject":"[PATCH 3/3] send-email: test compose functionality","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-22T03:29:05Z","receivedAt":"2008-01-22T03:29:05Z","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. Unfortunately, we have to add a --no-confirm-send\noption to git-send-email to make this work, since it\notherwise unconditionally tries to talk to the terminal.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nNote that the change to git-send-email depends textually on Gustaf's\nfix (actually, on my suggested version). I am not happy with adding the\n--no-confirm-send option, but there just isn't any way to avoid the\nreadline call with the existing code short of providing a dummy perl\nmodule in the test harness.\n\n git-send-email.perl   |   16 ++++++++++------\n t/t9001-send-email.sh |   27 +++++++++++++++++++++++++++\n 2 files changed, 37 insertions(+), 6 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex df1c833..f265a82 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -180,6 +180,7 @@ my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n my ($no_validate);\n+my ($no_confirm_send);\n \n my %config_bool_settings = (\n     \"thread\" => [\\$thread, 1],\n@@ -226,6 +227,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n \t\t    \"thread!\" => \\$thread,\n \t\t    \"no-validate\" => \\$no_validate,\n+\t\t    \"no-confirm-send\" => \\$no_confirm_send,\n \t );\n \n unless ($rc) {\n@@ -453,13 +455,15 @@ EOT\n \tclose(C);\n \tclose(C2);\n \n-\tdo {\n-\t\t$_ = $term->readline(\"Send this email? (y|n) \");\n-\t} while (!defined $_);\n+\tif (!$no_confirm_send) {\n+\t\tdo {\n+\t\t\t$_ = $term->readline(\"Send this email? (y|n) \");\n+\t\t} while (!defined $_);\n \n-\tif (uc substr($_,0,1) ne 'Y') {\n-\t\tcleanup_compose_files();\n-\t\texit(0);\n+\t\tif (uc substr($_,0,1) ne 'Y') {\n+\t\t\tcleanup_compose_files();\n+\t\t\texit(0);\n+\t\t}\n \t}\n \n \tunshift @files, \"$compose_filename.final\";\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex dd0c395..b1e9de5 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -114,4 +114,31 @@ test_expect_success 'allow long lines with --no-validate' '\n \t\t2>errors\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+\tGIT_EDITOR=$(pwd)/fake-editor \\\n+\tgit send-email \\\n+\t\t--compose --subject foo --no-confirm-send \\\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.rc3.1130.gd9718-dirty\n"}]}