[PATCH 0/3] config: support scp-style --url
Fabian Pottbäcker <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
Almost all git commands support the same set of URL formats, which includes the scp-style shortcut for ssh. This format is the default format of multiple large git services, presented to users when pressing a clone button. The config --url option was a notable exception. This is only relevant for scripting, it only affects the config get command. This series consists of three commits: the first adds URL default port normalization to FTP and SSH, the second adds some git-config tests for --url which seemed missing (present for --get-urlmatch), and the third uses the recently added `url_parse` to support scp-style URLs in --url. Uses in scripting of this change include smaller tools to automatically configure some settings based on some remote, like setting up author info based on a user git config value scoped to ssh://service.com, which is useful because git hosters often offer an email obfuscation/forwarding feature and this would enable easier management of identities with multiple accounts (like work and private). This could of course be more useful with adjustments to `fmt_ident` to support this, with appropriate config options (what remote, copy values to repo config or use globals automatically, ...). Which would have been somewhat out of scope for this and requiring some more intricate changes I did not feel comfortable with yet. Fabian Pottbäcker (3): urlmatch: normalize ssh and ftp default ports t1300: cover --url for some --get-urlmatch tests config: use url_parse for --url Documentation/git-config.adoc | 5 +++ builtin/config.c | 2 +- t/t1300-config.sh | 58 +++++++++++++++++++++++++ t/unit-tests/u-urlmatch-normalization.c | 9 ++++ urlmatch.c | 16 +++++-- 5 files changed, 85 insertions(+), 5 deletions(-) base-commit: 9a0c4701dcd5725c4184599322b52933ff5005ca -- 2.50.1 (Apple Git-155)