Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH v3] send-email: recognize absolute path on Windows

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:00:46

Erik Faye-Lund [off-list ref] writes:
quoted
quoted
Shouldn't the latter also be anchored at the beginning of the string
with a leading "^"?
quoted
+    }
+
+    require File::Spec::Functions;
+    return File::Spec::Functions::file_name_is_absolute($path);
We already "use File::Spec qw(something else)" at the beginning, no?
Why not throw file_name_is_absolute into that qw() instead?
Ahh, OK, if you did so, you won't have any place to hook the "only
on msys do this" trick into.

It somehow feels somewhat confusing that we define a sub with the
same name as the system one, while not overriding it entirely but
delegate back to the system one.  I am debating myself if it is more
obvious if it is done this way:

        use File::Spec::Functions qw(file_name_is_absolute);
        if ($^O eq 'msys') {
                sub file_name_is_absolute {
                        return $_[0] =~ /^\// || $_[0] =~ /^[A-Z]:/i;
                }
        }
In this case, we end up requiring that module even when we end up
using it, no?
Also somebody earlier mentioned that we would be redefining, which
has a different kind of ugliness, so I'd agree with the code structure
of what you sent out (which has been queued on 'pu').

My earlier question "don't we want to make sure 'C:' is at the
betginning of the string?" still stands, though.  I do not think I
futzed with your regexp in the version I queued on 'pu'.

Thanks.


-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help