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

git resolver error on windows with space in username #648

Open
dsisnero opened this issue Oct 15, 2024 · 1 comment
Open

git resolver error on windows with space in username #648

dsisnero opened this issue Oct 15, 2024 · 1 comment

Comments

@dsisnero
Copy link

On my work computer my username has a space "Dominic E Sisneros" -( not by choice)

When trying to install crimson, I get an error because of this space in trying to build:

Resolving dependencies
Fetching https://github.com/naqvis/crystar.git
Fetching https://github.com/devnote-dev/cling.git
Fetching https://github.com/mamantoha/crest.git
Fetching https://github.com/mamantoha/http-client-digest_auth.git
Fetching https://github.com/mamantoha/http_proxy.git
Installing cling (3.0.0 at b833b59)
Installing http-client-digest_auth (0.6.0)
Installing http_proxy (0.12.0)
Installing crest (1.4.1)
Installing crystar (0.4.0)
Failed git --work-tree=C:\windows_home\src\crystal_repos\crimson\lib\crystar checkout refs/tags/v0.4.0 -- ..
basename: extra operand ‘Sisneros/AppData/Local/shards/cache/github.com/naqvis/crystar.git/./hooks/post-checkout’
Try 'basename --help' for more information.
C:/Users/Dominic E Sisneros/AppData/Local/shards/cache/github.com/naqvis/crystar.git/./hooks/post-checkout: line 17: C:/Users: Is a directory
Hook C:/Users failed with error code 126

Same error with shards install:

C:\windows_home\src\crystal_repos\crimson>shards install
Resolving dependencies
Fetching https://github.com/devnote-dev/cling.git
Fetching https://github.com/mamantoha/crest.git
Fetching https://github.com/naqvis/crystar.git
Fetching https://github.com/mamantoha/http-client-digest_auth.git
Fetching https://github.com/mamantoha/http_proxy.git
Using cling (3.0.0 at b833b59)
Using http-client-digest_auth (0.6.0)
Using http_proxy (0.12.0)
Using crest (1.4.1)
Installing crystar (0.4.0)
Failed git --work-tree=C:\windows_home\src\crystal_repos\crimson\lib\crystar checkout refs/tags/v0.4.0 -- ..
basename: extra operand ‘Sisneros/AppData/Local/shards/cache/github.com/naqvis/crystar.git/./hooks/post-checkout’
Try 'basename --help' for more information.
C:/Users/Dominic E Sisneros/AppData/Local/shards/cache/github.com/naqvis/crystar.git/./hooks/post-checkout: line 17: C:/Users: Is a directory
Hook C:/Users failed with error code 126
@straight-shoota
Copy link
Member

According to the error message, the error is coming from the post-checkout hook in crystar.git. I don't think shards has anything to do with it directly.
However, since the cached repo is managed by shards, it should usually not have any hooks defined whatsoever. Shards certainly does not initiate installing any hooks. So why is it there?
My guess is the hook is installed automatically from git's template directory. Take a look at git config --get init.templateDir to see if the hook is defined there.

For a quick fix, you could simply remove C:/Users/Dominic E Sisneros/AppData/Local/shards/cache/github.com/naqvis/crystar.git/./hooks/post-checkout.

Having customized user configuration screw up shard's repo caching is not good. I think shards should probably prevent installing custom hooks. Or really any customization. It should just clone the upstream repo plainly without any modifications.

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

No branches or pull requests

2 participants