Hacker News new | past | comments | ask | show | jobs | submit login

I (submitter) hit this with pre-commit, for whatever reason `pre-commit` hooks all seem to specify `git://` addresses, which had been copy-pasted into our config (some by me).

I've never otherwise used `git://`, and I simply changed them all to `https://`, but I suspect it's mostly that sort of thing that'll bite people - something suddenly stopped working because something else made that decision, and maybe it's buried in a dependency used in CI, and a python library for running git operations, so you can't even find it by grepping, etc.

So while mine especially wasn't hard to fix, I just thought it might be a helpful PSA for people to keep in mind and maybe remember if something goes wrong.




> I just thought it might be a helpful PSA for people to keep in mind and maybe remember if something goes wrong

Oh, it was - I'm sure there's a lot of people who are being bitten by this, and nothing I said above should be seen as saying that your post was not useful. :)


I’m curious, where did you get those pre-commit configs from? I’ve seen many projects use pre-commit, and all of them use https. From what I know, pre-commit’s documentation also only provides examples with https repos, not git:, from pretty much Day One. It’s probably a good idea to tell whoever created the config to fix their materials, for more than this particular reason.


Well I didn't look into it thoroughly, I just wondered how/why we ended up with `git://` (as I say, that's never what I use personally - I knew I wouldn't have written it - but I was to `blame` for some of them) and at least a couple that I checked linked from the list on the pre-commit site to GitHub had a copy-pastable 'add this to your config' with `git://` in the readme.


  git config --global url."https://".insteadOf git://


I wouldn't be that scattershot, and would instead include "github.com" in the key and value. This is because you may actually want to to SSH clones of non-GH repos, such as if you also deal with Gerrit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: