-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An idea to prevent CMD from picking up any git.exe in the current directory #1945
Comments
Have you tested your idea? |
Sorry to bother you. My idea of using git.com can not pass any simple test. Maybe R:\working$ DOSKEY git=D:\Git\mingw64\bin\git.exe $*
R:\working$ git --version
git version 2.19.2.windows.1
R:\working$ .\git --version
ls (GNU coreutils) 8.30
... This new idea is learned from https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt. |
Not at all!
That's too sad...
That's a really good idea! I just performed a few tests with this, and it seems to work quite well! |
This is based on a proposal by Dahan Gong in git-for-windows/git#1945: use DOSKEY to force the intended `git.exe` to be used when a command line such as `git show HEAD` is called. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fixed via git-for-windows/MINGW-packages@8217238 |
Thanks. BTW, I just wonder whether the commit can still work even when |
Um... A sadly news is, I just test a new command of |
It should, as the path is inside quotes.
That is indeed sad! Oh well. At least it works for the common case, as it is quite unusual to pipe something into So I guess we keep Git CMD deprecated, but ship with your fix from now on? |
Git CMD [no longer picks up `git.exe` from the current directory (if any)](git-for-windows/git#1945). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
You could have a look here if, you get the SafeDllSearchMode somehow
enabled for the process and child processes.
https://docs.microsoft.com/en-us/windows/desktop/dlls/dynamic-link-library-search-order
…On Fri, Nov 23, 2018 at 5:10 AM Johannes Schindelin < ***@***.***> wrote:
I just wonder whether the commit can still work even when @@EXEPATH@@
contains any space characters.
It should, as the path is inside quotes.
A sadly news is, I just test a new command of echo 1 | git log, and find
that CMD fallback to search PATH for git.exe.
That is indeed sad! Oh well. At least it works for the common case, as it
is quite unusual to pipe something into git, especially in CMD.
So I guess we keep Git CMD deprecated, but ship with your fix from now on?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1945 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHJ-yP2a7jYtV70Qo9Ovqc0mBORS4dIIks5ux8l9gaJpZM4Yuq5c>
.
|
@mfriedrich74 if you somehow get the SafeDllSearchMode to apply to CMD's .exe search, that will be quite the trick. |
The release note in https://github.com/git-for-windows/git/releases/tag/v2.19.2.windows.1 says:
I agree with it, but I think there may be a way to make CMD not use the
git.exe
in the current directory - according to$PATHEXT
,git.com
takes precedence overgit.exe
, so if only there's/usr/bin/git.com
, then a command likegit status
will use it directly.Just a naive idea~
The text was updated successfully, but these errors were encountered: