Re: [PATCH v3 0/8] builtin: implement, document and test url-parse
- From
Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
- Date
- May 3, 2026, 04:29 UTC
- Message-ID
- <b7155ff9d03be5b1baa1358fe8a5f434@matheusmoreira.com>
- In-Reply-To
- <xmqqik95taoh.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> Nitpick. With "git url-parse", these scripts has to do what they > traditionally have always done, i.e., shell out to the command, no?
It's a good point. I should have worded it better:
Tools wanting to reason about them have historically had to reimplement git's parsing logic externally. With git url-parse, scripts can delegate URL parsing to git's own parser: validate a URL, extract a component (scheme, user, host, port, path, password), or both.
What I meant to say is that git's URL parsing was never exposed as a standalone operation, leading external tools to reimplement the logic themselves.
For example:
npm/git-url-parse millions of weekly downloads
crates/git-url-parse half a million downloadsWith this builtin, scripts can rely on git's own parser instead of a third party reimplementation.
References:
https://www.npmjs.com/package/git-url-parse
https://crates.io/crates/git-url-parse