Re: [PATCH 4/4] Add a basic test case for git send-email, and fix some real bugs discovered.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -387,7 +387,9 @@ X-Mailer: git-send-email $gitversion
                my $pid = open my $sm, '|-';
                defined $pid or die $!;
                if (!$pid) {
-                       exec($smtp_server,'-i',@recipients) or die $!;

This construction (perl pipe+fork) will not work on ActiveState Perl
(it does not even parse the construct).
Last time the problem arised it was suggested to replace readers
with "qx{command}". Regretfully there were no writer case back
then. I'd suggest using IPC::Open2 for portability. Like this:

 use IPC::Open2;
 my $fw;
 my $pid = open2(">&1", $fw, "perl", "-w");
 print $fw "exit 0\n";
 close($fw);'

But I wont. It was never portable in windows, no matter how hard
I tried. The best result was getting output from "cat -v", but "cat"
froze afterwards anyway, as "wc" or "perl" did. Besides, it the
command often freezes that poor imitation of xterm windows has.

There is also 2-argument "open" with damn careful quoting,
if anyone cares (dont think anyone does, for windows).
How about disabling the test on cygwin? (patch attached).
---
 t/t9001-send-email.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index a61da1e..c3a3737 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -25,6 +25,11 @@ test_expect_success \
      git add fake.sendmail
      GIT_AUTHOR_NAME="A" git commit -a -m "Second."'
 
+if test "$(uname -o)" = Cygwin; then
+    say "git-send-mail tests disabled on Windows"
+    # because of windows being such a crap
+else
+
 test_expect_success \
     'Extract patches and send' \
     'git format-patch -n HEAD^1
@@ -38,4 +43,6 @@ test_expect_success \
     'Verify commandline' \
     'diff commandline expected'
 
+fi
+
 test_done
-- 
1.3.3.g7994


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]