crystal-lang / shards

Dependency manager for the Crystal language
Other
766 stars 102 forks source link

Revert "Run `git config` instead of reading `config` file manually" #642

Closed straight-shoota closed 1 month ago

straight-shoota commented 2 months ago

The change is broken on Windows. This was masked by the CI failure due to #640.

E: Failed git config --get-regexp 'remote..+.mirror'.

Reverts crystal-lang/shards#639

beta-ziliani commented 2 months ago

But why does that command fails? is that an issue with git?

HertzDevil commented 2 months ago

I think it would work on Windows if the single quotation marks are dropped

straight-shoota commented 2 months ago

It's documented behaviour of git config to exit with code 1 if "the section or key is invalid". Apparently --get-regexp considers a non-matching expression as an invalid key.

And the git behavious is not specific on Windows, it works the same on Linux (and I presume MacOS as well). git config --get-regexp 'remote\..+\.mirror' on a repo with no matching remote in the config, exits with 1.

I just don't quite understand why this does not lead to a failure in shards on Linux and MacOS.