git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "András Kucsma" <andras.kucsma@gmail.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: GIT_ASKPASS absolute path detection bug on Windows
Date: Sun, 22 Mar 2020 19:33:19 +0100	[thread overview]
Message-ID: <CANPdQvLQ4WFKmK+_Vys4EeBsRaFR+CcCJs_ARQX=JPzPLjxsWw@mail.gmail.com> (raw)
In-Reply-To: <20200322180730.57pe4awhglmmlxpm@tb-raspi4>

On Sun, Mar 22, 2020 at 7:07 PM Torsten Bögershausen <tboegi@web.de> wrote:
> On Sun, Mar 22, 2020 at 04:59:15PM +0000, brian m. carlson wrote:
> > This function (locate_in_PATH) specifically says it is not to be used on
> > Windows because it doesn't work properly there due to file extensions.
>
> My reading is, that it dows work if you specify "foo.exe", "foo.bat".
> And when you specify "foo" it may use "foo.exe", but there may be
> a shell script called "foo".
> But I may be wrong.

Other than the extension appending, I believe the other difference is
that on native Windows the PATH separator is ';' (semi-colon). In
cygwin and mingw, PATH is translated to use ':' (colon).

>
> > I'm pretty sure a proper solution would involve touching that as well,
> > although your solution does indeed fix the issue you reported.  That
> > function also uses a colon-separated PATH, which I'm not sure will work
> > in all cases on Windows (although maybe it will).
> >
> > From looking at this earlier, I think the problem here is that we're
> > trying to use the Unix codepaths (on Cygwin) and then expecting those to
> > handle Windows-style paths, which they aren't intended to do.  This is
> > likely one of many problems on Cygwin.
>
> Yes and no.
> C:/MyTool.BAT is a valid Windows file name even under Windows.
> Cygwin preferres /cygdrive/cMyTool.BAT
> Git under Cygwin should handle C:/MyTool.BAT correctly, and to my
> understanding it does.
>

Indeed, the Cygwin shell tools recognize C:/Users style and even
C:\\Users style paths as well.


Looking at the code a bit more, I feel like git is only supposed to
work within a Unix compatibility layer (like Cygwin or Mingw shell) on
Windows. Beside the PATH and directory separator characters, the code
makes other Unix like assumptions, for example that /bin/sh (a.k.a.
SHELL_PATH), or /dev/null exists. If native Windows support is a goal,
I'm happy to help a bit to improve the situation, but I wouldn't want
to swim against the current. Note that other than this GIT_ASKPASS
related edge case, cygwin built git has been working in this
environment for me.

  reply	other threads:[~2020-03-22 18:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21 11:42 GIT_ASKPASS absolute path detection bug on Windows András Kucsma
2020-03-22  7:31 ` Torsten Bögershausen
2020-03-22 11:44   ` András Kucsma
2020-03-22 16:59     ` brian m. carlson
2020-03-22 18:07       ` Torsten Bögershausen
2020-03-22 18:33         ` András Kucsma [this message]
2020-03-22 18:59         ` Achim Gratz
2020-03-23 16:58     ` Torsten Bögershausen
2020-03-23 18:13       ` András Kucsma

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='CANPdQvLQ4WFKmK+_Vys4EeBsRaFR+CcCJs_ARQX=JPzPLjxsWw@mail.gmail.com' \
    --to=andras.kucsma@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    --cc=tboegi@web.de \
    /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 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 NNTP newsgroup(s).