git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, jrnieder@gmail.com
Subject: Re: [RFC PATCH] credential: minor documentation fixes
Date: Mon, 4 May 2020 08:39:57 -0700	[thread overview]
Message-ID: <20200504153957.GC86805@Carlos-MBP> (raw)
In-Reply-To: <20200504144436.GA9893@coredump.intra.peff.net>

On Mon, May 04, 2020 at 10:44:36AM -0400, Jeff King wrote:
> On Mon, May 04, 2020 at 12:45:20AM -0700, Carlo Marcelo Arenas Belón wrote:
> > 
> > * the meaning of "exactly" for matching protocol and hostname in the URL
> >   since 06 are both case insensitive per RFC3986 and we have been
> >   ambiguous on that, leading to some helpers assuming case or encoding.
> 
> Yeah, IIRC we discussed case-sensitivity at the time and went with the
> stricter behavior in the name of safety over convenience. And I don't
> think anybody has complained since then. So I'm not really _opposed_ to
> loosening it to match the URL, but perhaps a maintenance release is not
> the best time to do so.

agree, but I was talking not in the context of a feature, but on how we
are to define the interaction with helpers (which was meant to be part of
this maintenance release).

currently (since it is undefined) a naive helper could do a caseless match
by assuming we really meant url as defined by RFC3986, and therefore affect
the wrong credential by the operation.

indeed; our own code might get confused so maybe something like (not fully
tested and likely to need some test coverage) will make sense then as part
of this maintenance release, with some additional mention that clarifies
we REALLY meant "exactly" so that helpers can be updated?

Carlo
---
diff --git a/credential.c b/credential.c
index 108d9e183a..d2c879a9b3 100644
--- a/credential.c
+++ b/credential.c
@@ -70,7 +70,7 @@ static int proto_is_http(const char *s)
 {
 	if (!s)
 		return 0;
-	return !strcmp(s, "https") || !strcmp(s, "http");
+	return !strcasecmp(s, "https") || !strcasecmp(s, "http");
 }
 
 static void credential_describe(struct credential *c, struct strbuf *out);
diff --git a/fsck.c b/fsck.c
index 73f30773f2..d779acdae8 100644
--- a/fsck.c
+++ b/fsck.c
@@ -997,10 +997,10 @@ static int url_to_curl_url(const char *url, const char **out)
 	    skip_prefix(url, "ftp::", out) ||
 	    skip_prefix(url, "ftps::", out))
 		return 1;
-	if (starts_with(url, "http://") ||
-	    starts_with(url, "https://") ||
-	    starts_with(url, "ftp://") ||
-	    starts_with(url, "ftps://")) {
+	if (istarts_with(url, "http://") ||
+	    istarts_with(url, "https://") ||
+	    istarts_with(url, "ftp://") ||
+	    istarts_with(url, "ftps://")) {
 		*out = url;
 		return 1;
 	}

  reply	other threads:[~2020-05-04 15:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03  6:34 [RFC PATCH] credential: minor documentation fixes Carlo Marcelo Arenas Belón
2020-05-03  6:58 ` Jeff King
2020-05-04  7:45   ` Carlo Marcelo Arenas Belón
2020-05-04 14:44     ` Jeff King
2020-05-04 15:39       ` Carlo Marcelo Arenas Belón [this message]
2020-05-04 16:10         ` Jeff King
2020-05-04 15:58       ` Carlo Marcelo Arenas Belón
2020-05-04 16:13         ` Jeff King
2020-05-05  1:39 ` [PATCH 0/4] credential: documentation updates for maint Carlo Marcelo Arenas Belón
2020-05-05  1:39   ` [PATCH 1/4] credential: update description for credential_from_url_gently Carlo Marcelo Arenas Belón
2020-05-05  1:39   ` [PATCH 2/4] credential: correct order of parameters for credential_match Carlo Marcelo Arenas Belón
2020-05-05  1:39   ` [PATCH 3/4] credential: update gitcredentials documentation Carlo Marcelo Arenas Belón
2020-05-06 16:21     ` Jeff King
2020-05-05  1:39   ` [PATCH 4/4] credential: document protocol updates Carlo Marcelo Arenas Belón
2020-05-06 16:26     ` Jeff King
2020-05-06 16:27   ` [PATCH 0/4] credential: documentation updates for maint Jeff King
2020-05-06 23:28     ` Carlo Marcelo Arenas Belón
2020-05-07 20:59       ` Jeff King
2020-05-07 21:23         ` Carlo Marcelo Arenas Belón
2020-05-07 22:17           ` Jeff King
2020-05-07 23:35             ` Carlo Marcelo Arenas Belón
2020-05-06 21:47   ` [PATCH v2 " Carlo Marcelo Arenas Belón
2020-05-06 21:47     ` [PATCH v2 1/4] credential: update description for credential_from_url_gently Carlo Marcelo Arenas Belón
2020-05-06 21:47     ` [PATCH v2 2/4] credential: correct order of parameters for credential_match Carlo Marcelo Arenas Belón
2020-05-06 21:47     ` [PATCH v2 3/4] credential: update gitcredentials documentation Carlo Marcelo Arenas Belón
2020-05-07 20:54       ` Jeff King
2020-05-07 21:02         ` Junio C Hamano
2020-05-06 21:47     ` [PATCH v2 4/4] credential: document protocol updates Carlo Marcelo Arenas Belón
2020-05-07 20:57       ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200504153957.GC86805@Carlos-MBP \
    --to=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).