public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] contrib: Honor symbolic port in git-credential-netrc.
@ 2025-06-20  4:12 Maxim Cournoyer
  2025-06-20 13:48 ` Junio C Hamano
                   ` (9 more replies)
  0 siblings, 10 replies; 31+ messages in thread
From: Maxim Cournoyer @ 2025-06-20  4:12 UTC (permalink / raw)
  To: git; +Cc: Maxim Cournoyer

Symbolic ports were previously silently dropped, which made it
impossible to use them with git-credential-netrc. This is a supported
use case according to 'man git-send-email', for --smtp-server-port:

   [...] symbolic port names (e.g. "submission" instead of 587) are
   also accepted.
---
 contrib/credential/netrc/git-credential-netrc.perl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/credential/netrc/git-credential-netrc.perl b/contrib/credential/netrc/git-credential-netrc.perl
index 9fb998ae09..ad06000b9f 100755
--- a/contrib/credential/netrc/git-credential-netrc.perl
+++ b/contrib/credential/netrc/git-credential-netrc.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
@@ -267,7 +267,9 @@ sub load_netrc {
 		if (!defined $nentry->{machine}) {
 			next;
 		}
-		if (defined $nentry->{port} && $nentry->{port} =~ m/^\d+$/) {
+		if (defined $nentry->{port} && $nentry->{port} =~ m/^[[:alnum:]]+$/) {
+			# Port may be either an integer or a symbolic
+			# name, e.g. "smtps".
 			$num_port = $nentry->{port};
 			delete $nentry->{port};
 		}

base-commit: 9520f7d9985d8879bddd157309928fc0679c8e92
-- 
2.49.0


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

end of thread, other threads:[~2025-06-26  1:15 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20  4:12 [PATCH] contrib: Honor symbolic port in git-credential-netrc Maxim Cournoyer
2025-06-20 13:48 ` Junio C Hamano
2025-06-20 14:22   ` Andreas Schwab
2025-06-20 16:39     ` Junio C Hamano
2025-06-21 13:57     ` Maxim Cournoyer
2025-06-23  3:28   ` Maxim Cournoyer
2025-06-23  3:34   ` Maxim Cournoyer
2025-06-20 19:03 ` brian m. carlson
2025-06-21 13:29   ` Maxim Cournoyer
2025-06-21 15:52     ` brian m. carlson
2025-06-22 15:25 ` [PATCH v2 0/3] git-credential-netrc: better symbolic port names support Maxim Cournoyer
2025-06-22 15:25 ` [PATCH v2 1/3] contrib: use a more portable shebang for git-credential-netrc Maxim Cournoyer
2025-06-22 15:25 ` [PATCH v2 2/3] contrib: warn for invalid netrc file ports in git-credential-netrc Maxim Cournoyer
2025-06-22 15:25 ` [PATCH v2 3/3] contrib: better support symbolic port names " Maxim Cournoyer
2025-06-23 18:03   ` Junio C Hamano
2025-06-24  1:51     ` Maxim Cournoyer
2025-06-24  1:48 ` [PATCH v3 0/3] git-credential-netrc: better symbolic port names support Maxim Cournoyer
2025-06-24 16:04   ` Junio C Hamano
2025-06-24 23:55     ` Maxim Cournoyer
2025-06-25  0:24       ` Junio C Hamano
2025-06-25  1:03         ` Maxim Cournoyer
2025-06-25 14:25           ` [PATCH v4 " Maxim Cournoyer
2025-06-25 14:25             ` [PATCH v4 1/3] contrib: use a more portable shebang for git-credential-netrc Maxim Cournoyer
2025-06-25 14:25             ` [PATCH v4 2/3] contrib: warn for invalid netrc file ports in git-credential-netrc Maxim Cournoyer
2025-06-25 14:25             ` [PATCH v4 3/3] contrib: better support symbolic port names " Maxim Cournoyer
2025-06-25 16:49             ` [PATCH v4 0/3] git-credential-netrc: better symbolic port names support Junio C Hamano
2025-06-26  1:15               ` Maxim Cournoyer
2025-06-24  1:48 ` [PATCH v3 1/3] contrib: use a more portable shebang for git-credential-netrc Maxim Cournoyer
2025-06-24  1:48 ` [PATCH v3 2/3] contrib: warn for invalid netrc file ports in git-credential-netrc Maxim Cournoyer
2025-06-24  1:48 ` [PATCH v3 3/3] contrib: better support symbolic port names " Maxim Cournoyer
2025-06-24 16:06   ` Junio C Hamano

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