Skip to content
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

Lookup real git executable on Windows #1544

Open
kaste opened this issue May 13, 2022 · 1 comment
Open

Lookup real git executable on Windows #1544

kaste opened this issue May 13, 2022 · 1 comment

Comments

@kaste
Copy link
Collaborator

kaste commented May 13, 2022

it is quiOn Windows, where git typically returns a wrapper executable, e.g. C:\Dev\Git\cmd\git.exe. This wrapper is slower than using the real executable, for example located at

$ git --exec-path
C:/Dev/Git/mingw64/libexec/git-core

The complete absolute path to the binary is then "git_path": "C:\\Dev\\Git\\mingw64\\libexec\\git-core\\git.exe"

Initial conversation: magit/magit#1289 The current code in magit is quite complex. I think we can just use git --exec-path.

On my system modifying PATH is also not necessary.

@kaste
Copy link
Collaborator Author

kaste commented May 14, 2022

Timings using C:\Dev\Git\cmd\git.exe

 (D) [ 41ms] $ git status --porcelain -z -b
 (D) [ 45ms] $ git status --porcelain -z -b
 (D) [ 43ms] $ git status --porcelain -z -b
 (D) [ 43ms] $ git status --porcelain -z -b
 (D) [ 42ms] $ git status --porcelain -z -b

and using C:/Dev/Git/mingw64/libexec/git-core:

 (D) [ 33ms] $ git status --porcelain -z -b
 (D) [ 35ms] $ git status --porcelain -z -b
 (D) [ 36ms] $ git status --porcelain -z -b
 (D) [ 35ms] $ git status --porcelain -z -b
 (D) [ 27ms] $ git status --porcelain -z -b
 (D) [ 31ms] $ git status --porcelain -z -b
 (D) [ 36ms] $ git status --porcelain -z -b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant