{"thread":{"id":"36412","subject":"[PATCH] send-email: recognize absolute path on Windows","startedAt":"2014-04-15T08:44:25Z","lastAt":"2014-04-15T21:06:37Z","messageCount":8,"participants":["Erik Faye-Lund","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"238880","messageId":"1397551465-10968-1-git-send-email-kusmabite@gmail.com","threadId":"36412","inReplyTo":null,"subject":"[PATCH] send-email: recognize absolute path on Windows","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2014-04-15T08:44:25Z","receivedAt":"2014-04-15T08:44:25Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"From: Erik Faye-Lund <kusmabite@googlemail.com>\n\nOn Windows, absolute paths might start with a DOS drive prefix,\nwhich this check fails to recognize.\n\nUnfortunately, we cannot simply use the file_name_is_absolute\nhelper in File::Spec::Functions, because Git for Windows has an\nMSYS-based Perl, where this helper doesn't grok DOS\ndrive-prefixes.\n\nSo let's manually check for these in that case, and fall back to\nthe File::Spec-helper on other platforms (e.g Win32 with native\nPerl)\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n---\n\nHere's a patch that we've been running with a variation of in\nGit for Windows for a while. That version wasn't quite palatable,\nas it recognized DOS drive-prefixes on all platforms.\n\n git-send-email.perl | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex fdb0029..c4d85a7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1113,6 +1113,18 @@ sub ssl_verify_params {\n \t}\n }\n \n+sub file_name_is_absolute {\n+\tmy ($path) = @_;\n+\n+\t# msys does not grok DOS drive-prefixes\n+\tif ($^O eq 'msys') {\n+\t\treturn ($path =~ m#^/# || $path =~ m#[a-zA-Z]\\:#)\n+\t}\n+\n+\trequire File::Spec::Functions;\n+\treturn File::Spec::Functions::file_name_is_absolute($path);\n+}\n+\n # Returns 1 if the message was sent, and 0 otherwise.\n # In actuality, the whole program dies when there\n # is an error sending a message.\n@@ -1197,7 +1209,7 @@ X-Mailer: git-send-email $gitversion\n \n \tif ($dry_run) {\n \t\t# We don't want to send the email.\n-\t} elsif ($smtp_server =~ m#^/#) {\n+\t} elsif (file_name_is_absolute($smtp_server)) {\n \t\tmy $pid = open my $sm, '|-';\n \t\tdefined $pid or die $!;\n \t\tif (!$pid) {\n-- \n1.9.0.msysgit.0\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238882","messageId":"534D0ADB.7070702@viscovery.net","threadId":"36412","inReplyTo":"1397551465-10968-1-git-send-email-kusmabite@gmail.com","subject":"Re: [PATCH] send-email: recognize absolute path on Windows","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-04-15T10:32:59Z","receivedAt":"2014-04-15T10:32:59Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 4/15/2014 10:44, schrieb Erik Faye-Lund:\n> From: Erik Faye-Lund <kusmabite@googlemail.com>\n> \n> On Windows, absolute paths might start with a DOS drive prefix,\n> which this check fails to recognize.\n> \n> Unfortunately, we cannot simply use the file_name_is_absolute\n> helper in File::Spec::Functions, because Git for Windows has an\n> MSYS-based Perl, where this helper doesn't grok DOS\n> drive-prefixes.\n> \n> So let's manually check for these in that case, and fall back to\n> the File::Spec-helper on other platforms (e.g Win32 with native\n> Perl)\n> \n> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n> ---\n> \n> Here's a patch that we've been running with a variation of in\n> Git for Windows for a while. That version wasn't quite palatable,\n> as it recognized DOS drive-prefixes on all platforms.\n\nDid you consider patching msysgit's lib/perl5/5.8.8/File/Spec.pm by\ninserting a line \"msys => 'Win32',\" near the top of the file; it is the\nhash table that decides which path \"style\" is selected depending on $^O.\nThen File::Spec->file_name_is_absolute($path) could be used without a wrapper.\n\n> \n>  git-send-email.perl | 14 +++++++++++++-\n>  1 file changed, 13 insertions(+), 1 deletion(-)\n> \n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index fdb0029..c4d85a7 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1113,6 +1113,18 @@ sub ssl_verify_params {\n>  \t}\n>  }\n>  \n> +sub file_name_is_absolute {\n> +\tmy ($path) = @_;\n> +\n> +\t# msys does not grok DOS drive-prefixes\n> +\tif ($^O eq 'msys') {\n> +\t\treturn ($path =~ m#^/# || $path =~ m#[a-zA-Z]\\:#)\n> +\t}\n> +\n> +\trequire File::Spec::Functions;\n> +\treturn File::Spec::Functions::file_name_is_absolute($path);\n> +}\n> +\n>  # Returns 1 if the message was sent, and 0 otherwise.\n>  # In actuality, the whole program dies when there\n>  # is an error sending a message.\n> @@ -1197,7 +1209,7 @@ X-Mailer: git-send-email $gitversion\n>  \n>  \tif ($dry_run) {\n>  \t\t# We don't want to send the email.\n> -\t} elsif ($smtp_server =~ m#^/#) {\n> +\t} elsif (file_name_is_absolute($smtp_server)) {\n>  \t\tmy $pid = open my $sm, '|-';\n>  \t\tdefined $pid or die $!;\n>  \t\tif (!$pid) {\n> \n\nThere's another instance in the non-$quiet code path around line 1275 that\nneeds the same treatment.\n\n-- Hannes\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238885","messageId":"CABPQNSafmC-7zNJZJSZm598pF37_xUMUopgZ3c=ttL_wRDYsfQ@mail.gmail.com","threadId":"36412","inReplyTo":"534D0ADB.7070702@viscovery.net","subject":"Re: [PATCH] send-email: recognize absolute path on Windows","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2014-04-15T10:42:15Z","receivedAt":"2014-04-15T10:42:15Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Apr 15, 2014 at 12:32 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Am 4/15/2014 10:44, schrieb Erik Faye-Lund:\n>> From: Erik Faye-Lund <kusmabite@googlemail.com>\n>>\n>> On Windows, absolute paths might start with a DOS drive prefix,\n>> which this check fails to recognize.\n>>\n>> Unfortunately, we cannot simply use the file_name_is_absolute\n>> helper in File::Spec::Functions, because Git for Windows has an\n>> MSYS-based Perl, where this helper doesn't grok DOS\n>> drive-prefixes.\n>>\n>> So let's manually check for these in that case, and fall back to\n>> the File::Spec-helper on other platforms (e.g Win32 with native\n>> Perl)\n>>\n>> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n>> ---\n>>\n>> Here's a patch that we've been running with a variation of in\n>> Git for Windows for a while. That version wasn't quite palatable,\n>> as it recognized DOS drive-prefixes on all platforms.\n>\n> Did you consider patching msysgit's lib/perl5/5.8.8/File/Spec.pm by\n> inserting a line \"msys => 'Win32',\" near the top of the file; it is the\n> hash table that decides which path \"style\" is selected depending on $^O.\n> Then File::Spec->file_name_is_absolute($path) could be used without a wrapper.\n\nI did not, but that works, and is IMO much nicer. Thanks for the idea!\n\n>>\n>>  git-send-email.perl | 14 +++++++++++++-\n>>  1 file changed, 13 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index fdb0029..c4d85a7 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1113,6 +1113,18 @@ sub ssl_verify_params {\n>>       }\n>>  }\n>>\n>> +sub file_name_is_absolute {\n>> +     my ($path) = @_;\n>> +\n>> +     # msys does not grok DOS drive-prefixes\n>> +     if ($^O eq 'msys') {\n>> +             return ($path =~ m#^/# || $path =~ m#[a-zA-Z]\\:#)\n>> +     }\n>> +\n>> +     require File::Spec::Functions;\n>> +     return File::Spec::Functions::file_name_is_absolute($path);\n>> +}\n>> +\n>>  # Returns 1 if the message was sent, and 0 otherwise.\n>>  # In actuality, the whole program dies when there\n>>  # is an error sending a message.\n>> @@ -1197,7 +1209,7 @@ X-Mailer: git-send-email $gitversion\n>>\n>>       if ($dry_run) {\n>>               # We don't want to send the email.\n>> -     } elsif ($smtp_server =~ m#^/#) {\n>> +     } elsif (file_name_is_absolute($smtp_server)) {\n>>               my $pid = open my $sm, '|-';\n>>               defined $pid or die $!;\n>>               if (!$pid) {\n>>\n>\n> There's another instance in the non-$quiet code path around line 1275 that\n> needs the same treatment.\n\nGood catch, thanks!\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238893","messageId":"xmqq61maledq.fsf_-_@gitster.dls.corp.google.com","threadId":"36412","inReplyTo":"CABPQNSafmC-7zNJZJSZm598pF37_xUMUopgZ3c=ttL_wRDYsfQ@mail.gmail.com","subject":"Re* [PATCH] send-email: recognize absolute path on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-04-15T16:57:21Z","receivedAt":"2014-04-15T16:57:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n>>> Here's a patch that we've been running with a variation of in\n>>> Git for Windows for a while. That version wasn't quite palatable,\n>>> as it recognized DOS drive-prefixes on all platforms.\n>>\n>> Did you consider patching msysgit's lib/perl5/5.8.8/File/Spec.pm by\n>> inserting a line \"msys => 'Win32',\" near the top of the file; it is the\n>> hash table that decides which path \"style\" is selected depending on $^O.\n>> Then File::Spec->file_name_is_absolute($path) could be used without a wrapper.\n>\n> I did not, but that works, and is IMO much nicer. Thanks for the idea!\n> ...\n>> There's another instance in the non-$quiet code path around line 1275 that\n>> needs the same treatment.\n>\n> Good catch, thanks!\n\nThanks, both.  I'd expect another round then?\n\n-- >8 --\nFrom: Erik Faye-Lund <kusmabite@googlemail.com>\n\nOn Windows, absolute paths might start with a DOS drive prefix,\nwhich these checks fail to recognize.\n\nUse file_name_is_absolute from File::Spec::Functions for\nportability.  The Perl module msysgit has been shipping needs to be\nupdated for this patch to work, though.\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\nHelepd-by: Johannes Sixt <j6t@kdbg.org>\n---\n\n git-send-email.perl | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex fdb0029..eda3917 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -25,7 +25,7 @@\n use Data::Dumper;\n use Term::ANSIColor;\n use File::Temp qw/ tempdir tempfile /;\n-use File::Spec::Functions qw(catfile);\n+use File::Spec::Functions qw(catfile file_name_is_absolute);\n use Error qw(:try);\n use Git;\n \n@@ -1197,7 +1197,7 @@ sub send_message {\n \n \tif ($dry_run) {\n \t\t# We don't want to send the email.\n-\t} elsif ($smtp_server =~ m#^/#) {\n+\t} elsif (file_name_is_absolute($smtp_server)) {\n \t\tmy $pid = open my $sm, '|-';\n \t\tdefined $pid or die $!;\n \t\tif (!$pid) {\n@@ -1271,7 +1271,7 @@ sub send_message {\n \t\tprintf (($dry_run ? \"Dry-\" : \"\").\"Sent %s\\n\", $subject);\n \t} else {\n \t\tprint (($dry_run ? \"Dry-\" : \"\").\"OK. Log says:\\n\");\n-\t\tif ($smtp_server !~ m#^/#) {\n+\t\tif (file_name_is_absolute($smtp_server)) {\n \t\t\tprint \"Server: $smtp_server\\n\";\n \t\t\tprint \"MAIL FROM:<$raw_from>\\n\";\n \t\t\tforeach my $entry (@recipients) {\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238898","messageId":"CABPQNSYzKB1QbXwqBNX+e1vc70rx4koqS6Q7+q2QXPmi5MjDXw@mail.gmail.com","threadId":"36412","inReplyTo":"CABPQNSafmC-7zNJZJSZm598pF37_xUMUopgZ3c=ttL_wRDYsfQ@mail.gmail.com","subject":"Re: [PATCH] send-email: recognize absolute path on Windows","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2014-04-15T20:28:39Z","receivedAt":"2014-04-15T20:28:39Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Apr 15, 2014 at 12:42 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n> On Tue, Apr 15, 2014 at 12:32 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n>> Am 4/15/2014 10:44, schrieb Erik Faye-Lund:\n>>> From: Erik Faye-Lund <kusmabite@googlemail.com>\n>>>\n>>> On Windows, absolute paths might start with a DOS drive prefix,\n>>> which this check fails to recognize.\n>>>\n>>> Unfortunately, we cannot simply use the file_name_is_absolute\n>>> helper in File::Spec::Functions, because Git for Windows has an\n>>> MSYS-based Perl, where this helper doesn't grok DOS\n>>> drive-prefixes.\n>>>\n>>> So let's manually check for these in that case, and fall back to\n>>> the File::Spec-helper on other platforms (e.g Win32 with native\n>>> Perl)\n>>>\n>>> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n>>> ---\n>>>\n>>> Here's a patch that we've been running with a variation of in\n>>> Git for Windows for a while. That version wasn't quite palatable,\n>>> as it recognized DOS drive-prefixes on all platforms.\n>>\n>> Did you consider patching msysgit's lib/perl5/5.8.8/File/Spec.pm by\n>> inserting a line \"msys => 'Win32',\" near the top of the file; it is the\n>> hash table that decides which path \"style\" is selected depending on $^O.\n>> Then File::Spec->file_name_is_absolute($path) could be used without a wrapper.\n>\n> I did not, but that works, and is IMO much nicer. Thanks for the idea!\n\nActually, after having tried that, other stuff starts to break... So\nback to the drawing-board.\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238900","messageId":"xmqq1twyl46z.fsf@gitster.dls.corp.google.com","threadId":"36412","inReplyTo":"xmqq61maledq.fsf_-_@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH] send-email: recognize absolute path on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-04-15T20:37:24Z","receivedAt":"2014-04-15T20:37:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Thanks, both.  I'd expect another round then?\n>\n> -- >8 --\n> From: Erik Faye-Lund <kusmabite@googlemail.com>\n>\n> On Windows, absolute paths might start with a DOS drive prefix,\n> which these checks fail to recognize.\n>\n> Use file_name_is_absolute from File::Spec::Functions for\n> portability.  The Perl module msysgit has been shipping needs to be\n> updated for this patch to work, though.\n>\n> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n> Helepd-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>\n>  git-send-email.perl | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index fdb0029..eda3917 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -25,7 +25,7 @@\n>  use Data::Dumper;\n>  use Term::ANSIColor;\n>  use File::Temp qw/ tempdir tempfile /;\n> -use File::Spec::Functions qw(catfile);\n> +use File::Spec::Functions qw(catfile file_name_is_absolute);\n>  use Error qw(:try);\n>  use Git;\n>  \n> @@ -1197,7 +1197,7 @@ sub send_message {\n>  \n>  \tif ($dry_run) {\n>  \t\t# We don't want to send the email.\n> -\t} elsif ($smtp_server =~ m#^/#) {\n> +\t} elsif (file_name_is_absolute($smtp_server)) {\n>  \t\tmy $pid = open my $sm, '|-';\n>  \t\tdefined $pid or die $!;\n>  \t\tif (!$pid) {\n> @@ -1271,7 +1271,7 @@ sub send_message {\n>  \t\tprintf (($dry_run ? \"Dry-\" : \"\").\"Sent %s\\n\", $subject);\n>  \t} else {\n>  \t\tprint (($dry_run ? \"Dry-\" : \"\").\"OK. Log says:\\n\");\n> -\t\tif ($smtp_server !~ m#^/#) {\n> +\t\tif (file_name_is_absolute($smtp_server)) {\n\nObviously this has to be \"!file_name_is_absolute($smtp_server)\" ;-)\n\n>  \t\t\tprint \"Server: $smtp_server\\n\";\n>  \t\t\tprint \"MAIL FROM:<$raw_from>\\n\";\n>  \t\t\tforeach my $entry (@recipients) {\n>\n> -- \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238901","messageId":"CABPQNSbZvJQY-yYRf5ee_jjiqrVk5GYK-rZJ2ApH=t7c4V-nMA@mail.gmail.com","threadId":"36412","inReplyTo":"xmqq1twyl46z.fsf@gitster.dls.corp.google.com","subject":"Re: Re* [PATCH] send-email: recognize absolute path on Windows","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2014-04-15T20:49:53Z","receivedAt":"2014-04-15T20:49:53Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Apr 15, 2014 at 10:37 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Thanks, both.  I'd expect another round then?\n>>\n>> -- >8 --\n>> From: Erik Faye-Lund <kusmabite@googlemail.com>\n>>\n>> On Windows, absolute paths might start with a DOS drive prefix,\n>> which these checks fail to recognize.\n>>\n>> Use file_name_is_absolute from File::Spec::Functions for\n>> portability.  The Perl module msysgit has been shipping needs to be\n>> updated for this patch to work, though.\n>>\n>> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n>> Helepd-by: Johannes Sixt <j6t@kdbg.org>\n>> ---\n>>\n>>  git-send-email.perl | 6 +++---\n>>  1 file changed, 3 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index fdb0029..eda3917 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -25,7 +25,7 @@\n>>  use Data::Dumper;\n>>  use Term::ANSIColor;\n>>  use File::Temp qw/ tempdir tempfile /;\n>> -use File::Spec::Functions qw(catfile);\n>> +use File::Spec::Functions qw(catfile file_name_is_absolute);\n>>  use Error qw(:try);\n>>  use Git;\n>>\n>> @@ -1197,7 +1197,7 @@ sub send_message {\n>>\n>>       if ($dry_run) {\n>>               # We don't want to send the email.\n>> -     } elsif ($smtp_server =~ m#^/#) {\n>> +     } elsif (file_name_is_absolute($smtp_server)) {\n>>               my $pid = open my $sm, '|-';\n>>               defined $pid or die $!;\n>>               if (!$pid) {\n>> @@ -1271,7 +1271,7 @@ sub send_message {\n>>               printf (($dry_run ? \"Dry-\" : \"\").\"Sent %s\\n\", $subject);\n>>       } else {\n>>               print (($dry_run ? \"Dry-\" : \"\").\"OK. Log says:\\n\");\n>> -             if ($smtp_server !~ m#^/#) {\n>> +             if (file_name_is_absolute($smtp_server)) {\n>\n> Obviously this has to be \"!file_name_is_absolute($smtp_server)\" ;-)\n>\n\nHeh, yeah. Apart from that, your patch is identical to mine. But, ugh.\nModifying File::Spec into thinking msys is Win32 doesn't seems to\nwork, as I get other random path-errors in that case:\n\n\"Error in tempdir() using \\tmp\\XXXXXXXXXX: Parent directory (\\tmp) is\nnot a directory at /libexec/git-core/git-send-email line 554\"\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"238902","messageId":"xmqqsipejo9u.fsf@gitster.dls.corp.google.com","threadId":"36412","inReplyTo":"CABPQNSbZvJQY-yYRf5ee_jjiqrVk5GYK-rZJ2ApH=t7c4V-nMA@mail.gmail.com","subject":"Re: Re* [PATCH] send-email: recognize absolute path on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-04-15T21:06:37Z","receivedAt":"2014-04-15T21:06:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n> ... But, ugh.\n> Modifying File::Spec into thinking msys is Win32 doesn't seems to\n> work,\n\nOK, I'll drop the tentative version and wait for a proper reroll.\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"}]}