Git development
 help / color / mirror / Atom feed
From: "Fabian Pottbäcker" <fpottbaecker+git@mailbox.org>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Fabian Pottbäcker" <fpottbaecker+git@mailbox.org>
Subject: [PATCH 0/3] config: support scp-style --url
Date: Fri, 24 Jul 2026 02:40:08 +0200	[thread overview]
Message-ID: <20260724004011.41795-1-fpottbaecker+git@mailbox.org> (raw)

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)


             reply	other threads:[~2026-07-24  0:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  0:40 Fabian Pottbäcker [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260724004011.41795-1-fpottbaecker+git@mailbox.org \
    --to=fpottbaecker+git@mailbox.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox