Hey. I'm on windows and doom will fail if I have /c/Users/me/Apps/msys64/usr/bin first on the path because it doesn't like that version of git.exe but clojure things will fail if I have /c/Users/me/Apps/PortableGit/bin first on the path. e.g. Today bb print-deps --format classpath failed. Idk what that does but emacs was trying to run it and I saw it fail on the command line and then pass after I changed the path.
What do you do?
What is the version of git? And what error are you seeing? There is an env var to get more output from what deps is doing with git
On a flight / phone right now but hopefully that was helpful. There is a minimal git version necessary
A year ago, you and Alex Miller helped me debug why msys2 git wasn't working. https://clojurians.slack.com/archives/CFN4QDHPS/p1663084510338879 Since then I've just been changing my PATH around whenever I have an issue. Today, what I was thinking about was that maybe there's a way to get a tool to use the "right" version of git and I wasn't thinking critically about what is really the issue.
$ which git
/c/Users/me/Apps/msys64/usr/bin/git
$ git --version
git version 2.41.0
$ export GITLIBS_DEBUG=true
$ export GIT_TRACE=1
$ bb print-deps --format classpath
git --git-dir C:\Users\me\.gitlibs\_repos\https\\babashka\babashka.core rev-parse 52a6037bd4b632bffffb04394fb4efd0cdab6b1e^{commit}
13:49:24.483767 git.c:462 trace: built-in: git rev-parse 52a6037bd4b632bffffb04394fb4efd0cdab6b1e^commit
fatal: ambiguous argument '52a6037bd4b632bffffb04394fb4efd0cdab6b1e^commit': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
git --git-dir C:\Users\me\.gitlibs\_repos\https\\babashka\babashka.core fetch --quiet --all --tags --prune
13:49:24.584462 git.c:462 trace: built-in: git fetch --quiet --all --tags --prune
13:49:24.590680 run-command.c:661 trace: run_command: git remote-https origin
13:49:24.625613 git.c:748 trace: exec: git-remote-https origin
13:49:24.626521 run-command.c:661 trace: run_command: git-remote-https origin
13:49:25.010598 run-command.c:661 trace: run_command: git rev-list --objects --stdin --not --exclude-hidden=fetch --all --quiet --alternate-refs
13:49:25.051380 run-command.c:661 trace: run_command: git maintenance run --auto --quiet
13:49:25.075233 git.c:462 trace: built-in: git maintenance run --auto --quiet
git --git-dir C:\Users\me\.gitlibs\_repos\https\\babashka\babashka.core rev-parse 52a6037bd4b632bffffb04394fb4efd0cdab6b1e^{commit}
13:49:25.118679 git.c:462 trace: built-in: git rev-parse 52a6037bd4b632bffffb04394fb4efd0cdab6b1e^commit
fatal: ambiguous argument '52a6037bd4b632bffffb04394fb4efd0cdab6b1e^commit': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error building classpath. Commit not found for babashka/babashka.core in repo at 52a6037bd4b632bffffb04394fb4efd0cdab6b1e
Exception in thread "main" java.io.FileNotFoundException: C:\Users\me\.clojure\.cpcache\634DCD22949412C845B3895A78D82560.cp (The system cannot find the path specified)
at java.base@11.0.17/java.io.FileInputStream.open0(FileInputStream.java)
at java.base@11.0.17/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base@11.0.17/java.io.FileInputStream.<init>(FileInputStream.java:157)
at $fn__11617.invokeStatic(io.clj:229)
at $fn__11617.invoke(io.clj:229)
at $fn__11569$G__11523__11576.invoke(io.clj:69)
at $fn__11591.invokeStatic(io.clj:165)
at $fn__11591.invoke(io.clj:165)
at $fn__11530$G__11519__11537.invoke(io.clj:69)
at $reader.invokeStatic(io.clj:102)
at $reader.doInvoke(io.clj:86)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$slurp.invokeStatic(core.clj:7009)
at clojure.core$slurp.doInvoke(core.clj:7009)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at borkdude.deps$_main.invokeStatic(deps.clj:808)
at borkdude.deps$_main.doInvoke(deps.clj:575)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at babashka.deps$clojure.invokeStatic(deps.clj:42)
at babashka.impl.print_deps$print_deps$fn__27175.invoke(print_deps.clj:40)
at babashka.impl.print_deps$print_deps.invokeStatic(print_deps.clj:40)
at babashka.main$exec.invokeStatic(main.clj:971)
at babashka.main$main.invokeStatic(main.clj:1093)
at babashka.main$main.doInvoke(main.clj:1063)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at babashka.main$_main.invokeStatic(main.clj:1126)
at babashka.main$_main.doInvoke(main.clj:1118)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at babashka.main.main(Unknown Source)
g2g;brbOh, and the doom error:
> Updating recipe repos...
x The package manager threw an error
x Last 16 lines of straight's error log:
[Return code: 0]
$ cd c\:/Users/me/.config/emacs/.local/straight/repos/melpa/
$ git config --get remote.origin.url
[Return code: 0]
$ cd c\:/Users/me/.config/emacs/.local/straight/repos/melpa/
$ git fetch origin
0 [main] git (23584) C:\Users\me\Apps\msys64\usr\lib\git-core\git.exe: *** fatal error - cygheap base mismatch detected - 0x800000000/0x210351408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
fatal: full write to remote helper failed: Broken pipe
[Return code: 128]
! Wrote extended straight log to ~/.config/emacs/.local/state/logs/cli.doom.230923130812.1828.error
! Script was abruptly aborted, leaving Doom in an incomplete state!
- Run 'doom sync' to repair it.
I'll try and reproduce the doom error with the extra debugging info from GITLIBS_DEBUG=true and GIT_TRACE=1.
It's not a blocker. It's just annoying. The issue with using the msys2 git with clojure stuff might be something to do with string escaping https://stackoverflow.com/questions/51625659/how-to-escape-curly-braces-u-of-upstream-in-git-alias-git-bash-on-windows but I'm thinking it's more likely that I have a broken setup. I was re-reading that SO answer about how it's bad to have two conflicting msys-2.0.dll and I just realized that I only had /c/Users/me/Apps/PortableGit/bin on my path (which has git.exe) and not /c/Users/me/Apps/PortableGit/usr/bin (which has msys-2.0.dll). So, I think I was crossing things. I don't know how to test since I've already upgraded doom and it's not breaking anymore. I'll find out in the future. Or not which wouldn't be so bad.
Thanks for making me think about it!I switched from using Git for Windows to using Git for Windows SDK and I haven't had any problems. There are two download links on https://gitforwindows.org/. Git for Windows is at the top and Git for Windows SDK is all the way at the bottom. I don't remember exactly why it matters.