builtin: implement, document and test url-parse
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest13 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | url: move helper function to URL header and sourceconnect.c connect.h remote.c +2 more | +11 | 0 replies | |
| 2/13 | urlmatch: define url_parse functionurlmatch.c urlmatch.h | +91 | 2 replies | |
| 3/13 | builtin: create url-parse command.gitignore Makefile builtin.h +3 more | +23 | 0 replies | |
| 4/13 | url-parse: add URL parsing helper functionbuiltin/ | +10 | 0 replies | |
| 5/13 | url-parse: enumerate possible URL componentsbuiltin/ | +10 | 0 replies | |
| 6/13 | url-parse: define component extraction helper fnbuiltin/ | +36 | 0 replies | |
| 7/13 | url-parse: define string to component converter fnbuiltin/ | +17 | 0 replies | |
| 8/13 | url-parse: define usage and optionsbuiltin/ | +14 | 0 replies | |
| 9/13 | url-parse: parse options given on the command linebuiltin/ | +5 | 0 replies | |
| 10/13 | url-parse: validate all given git URLsbuiltin/ | +8 | 0 replies | |
| 11/13 | url-parse: output URL components selected by userbuiltin/ | +14 | 0 replies | |
| 12/13 | Documentation: describe the url-parse builtinDocumentation/ | +59 | 1 reply | |
| 13/13 | tests: add tests for the new url-parse builtint/ | +194 | 0 replies |
Reviews trailers per patch
None of the 13 patches has a Reviewed-by or Acked-by.
| Patch | Ghanshyam Thakkar |
|---|---|
| Series | Helped-by Helped-by |
| 1/13 | |
| 2/13 | |
| 3/13 | |
| 4/13 | |
| 5/13 | |
| 6/13 | |
| 7/13 | |
| 8/13 | |
| 9/13 | |
| 10/13 | |
| 11/13 | |
| 12/13 | |
| 13/13 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/13] builtin: implement, document and test url-parse
Git commands accept a wide variety of URLs syntaxes, not just standard URLs. This can make parsing git URLs difficult since standard URL parsers cannot be used. Even if an external parser were implemented, it would have to track git's development closely in case support for any new URL schemes are added.
These patches introduce a new url-parse builtin command that exposes git's native URL parsing algorithms as a plumbing command, allowing other programs to then call upon git itself to parse the git URLs and their components.
This should be quite useful for scripts. For example, a script might want to add remotes to repositories, naming them according to the domain name where the repository is hosted. This new builtin allows it to parse the git URL and extract its host name which can then be used as input for other operations. This would be difficult to implement otherwise due to git's support for scp style URLs.
Matheus Afonso Martins Moreira (13):
url: move helper function to URL header and source
urlmatch: define url_parse function
builtin: create url-parse command
url-parse: add URL parsing helper function
url-parse: enumerate possible URL components
url-parse: define component extraction helper fn
url-parse: define string to component converter fn
url-parse: define usage and options
url-parse: parse options given on the command line
url-parse: validate all given git URLs
url-parse: output URL components selected by user
Documentation: describe the url-parse builtin
tests: add tests for the new url-parse builtin
.gitignore | 1 + Documentation/git-url-parse.txt | 59 ++++++++++ Makefile | 1 + builtin.h | 1 + builtin/url-parse.c | 132 ++++++++++++++++++++++ command-list.txt | 1 + connect.c | 8 -- connect.h | 1 - git.c | 1 + remote.c | 1 + t/t9904-url-parse.sh | 194 ++++++++++++++++++++++++++++++++ url.c | 8 ++ url.h | 2 + urlmatch.c | 90 +++++++++++++++ urlmatch.h | 1 + 15 files changed, 492 insertions(+), 9 deletions(-) create mode 100644 Documentation/git-url-parse.txt create mode 100644 builtin/url-parse.c create mode 100755 t/t9904-url-parse.sh
base-commit: e326e520101dcf43a0499c3adc2df7eca30add2d
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1715%2Fmatheusmoreira%2Furl-parse-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1715/matheusmoreira/url-parse-v1
Pull-Request: https://github.com/git/git/pull/1715
Signature · 1 line
gitgitgadget