"Matheus Moreira via GitGitGadget" [off-list ref] writes:
... Tools wanting to reason
about them have historically had to reimplement git's parsing or shell out
indirectly. With git url-parse, scripts can ask git directly: validate a
URL, extract a component (scheme, user, host, port, path, password), or
both.
Nitpick. With "git url-parse", these scripts has to do what they
traditionally have always done, i.e., shell out to the command, no?
Junio C Hamano [off-list ref] 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 downloads
With 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