Re: [PATCH v3 0/8] builtin: implement, document and test url-parse

2 messages, 2 authors, 2026-05-03 · open the first message on its own page

Re: [PATCH v3 0/8] builtin: implement, document and test url-parse

From: Junio C Hamano <hidden>
Date: 2026-05-03 03:49:05

"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?

Re: [PATCH v3 0/8] builtin: implement, document and test url-parse

From: Matheus Afonso Martins Moreira <hidden>
Date: 2026-05-03 04:29:46

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help