From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH 2/2] mingw: allow absolute paths without drive prefix
Date: Thu, 13 Dec 2018 11:48:13 +0900 [thread overview]
Message-ID: <xmqqmupagn0y.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <8a484f86-1d43-fc0a-22b4-39c770cda6cb@kdbg.org> (Johannes Sixt's message of "Tue, 11 Dec 2018 21:36:06 +0100")
Johannes Sixt <j6t@kdbg.org> writes:
>>>> + if (is_dir_sep(template[0]) && !is_dir_sep(template[1]) &&
>>>> + iswalpha(wtemplate[0]) && wtemplate[1] == L':') {
>>>> + /* We have an absolute path missing the drive prefix */
>>>
>>> This comment is true for the source part, template, but I can't find
>>> where the destination, wtemplate, suddenly gets the drive prefix. As far
>>> as I can see, xutftowcs_path() just does a plain textual conversion
>>> without any interpretation of the text as path. Can you explain it?
>>
>> It is legal on Windows for such a path to lack the drive prefix, also in
>> the wide-character version. So the explanation is: even `wtemplate` won't
>> get the drive prefix. It does not need to.
>
> I'm sorry, my question was extremely fuzzy. I actually wanted to know
> how the condition that you introduce in this patch can ever be true.
>
> And after looking at the Git for Windows code, I could answer it
> myself: it cannot. Not with this patch alone. In GfW, there is
> additional code in xutftowcs_path() that massages wtemplate to receive
> a drive prefix; but vanilla Git does not have that code, so that
> is_dir_sep(template[0]) and iswalpha(wtemplate[0]) can never be true
> at the same time at this point.
So,... what's the conclusion? The patch in the context of my tree
would be a no-op, and we'd need a prerequisite change to the support
function to accompany this patch to be effective?
next prev parent reply other threads:[~2018-12-13 2:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 18:47 [PATCH 0/2] mingw: support absolute paths without a drive prefix Johannes Schindelin via GitGitGadget
2018-12-10 18:47 ` [PATCH 1/2] mingw: demonstrate a problem with certain absolute paths Johannes Schindelin via GitGitGadget
2018-12-10 18:47 ` [PATCH 2/2] mingw: allow absolute paths without drive prefix Johannes Schindelin via GitGitGadget
2018-12-10 21:58 ` Johannes Sixt
2018-12-11 11:25 ` Johannes Schindelin
2018-12-11 20:36 ` Johannes Sixt
2018-12-13 2:48 ` Junio C Hamano [this message]
2018-12-13 6:25 ` Johannes Sixt
2018-12-13 19:38 ` Johannes Sixt
2018-12-14 11:31 ` Johannes Schindelin
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmupagn0y.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=j6t@kdbg.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).