All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: kusmabite@gmail.com
Cc: GIT Mailing-list <git@vger.kernel.org>,
	 msysGit <msysgit@googlegroups.com>,
	 Johannes Schindelin <johannes.schindelin@gmx.de>,
	 Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: [PATCH v3] send-email: recognize absolute path on Windows
Date: Tue, 22 Apr 2014 09:50:47 -0700	[thread overview]
Message-ID: <xmqqk3ah71g8.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CABPQNSbcWjg3nLPD9U114zSk5rBNupOGLr901u4ptCkdiiKvCA@mail.gmail.com> (Erik Faye-Lund's message of "Tue, 22 Apr 2014 14:15:59 +0200")

Erik Faye-Lund <kusmabite@gmail.com> writes:

>>> Shouldn't the latter also be anchored at the beginning of the string
>>> with a leading "^"?
>>>
>>>> +    }
>>>> +
>>>> +    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.

  reply	other threads:[~2014-04-22 16:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  8:08 [PATCH v3] send-email: recognize absolute path on Windows Erik Faye-Lund
2014-04-16 17:03 ` Junio C Hamano
2014-04-16 17:19   ` Junio C Hamano
2014-04-17  1:45     ` brian m. carlson
2014-04-22 12:15     ` Erik Faye-Lund
2014-04-22 16:50       ` Junio C Hamano [this message]
2014-04-23  9:30         ` Erik Faye-Lund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk3ah71g8.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=johannes.schindelin@gmx.de \
    --cc=kusmabite@gmail.com \
    --cc=msysgit@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.