Git development
 help / color / mirror / Atom feed
* [PATCH 0/3] config: support scp-style --url
@ 2026-07-24  0:40 Fabian Pottbäcker
  2026-07-24  0:40 ` [PATCH 1/3] urlmatch: normalize ssh and ftp default ports Fabian Pottbäcker
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabian Pottbäcker @ 2026-07-24  0:40 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Patrick Steinhardt, Fabian Pottbäcker

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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-24  0:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24  0:40 [PATCH 0/3] config: support scp-style --url Fabian Pottbäcker
2026-07-24  0:40 ` [PATCH 1/3] urlmatch: normalize ssh and ftp default ports Fabian Pottbäcker
2026-07-24  0:40 ` [PATCH 2/3] t1300: cover --url for some --get-urlmatch tests Fabian Pottbäcker
2026-07-24  0:40 ` [PATCH 3/3] config: use url_parse for --url Fabian Pottbäcker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox