Re: [PATCH] Disown ssh+git and git+ssh
- From
Jeff King <peff@peff.net>
- Date
- Feb 12, 2016, 18:40 UTC
- Message-ID
- <20160212184023.GD19973@sigill.intra.peff.net>
- In-Reply-To
- <1455289777-186690-1-git-send-email-cmn@dwim.me>
On Fri, Feb 12, 2016 at 04:09:37PM +0100, Carlos Martín Nieto wrote:
> These were silly from the beginning, but we have to support them for > compatibility. That doesn't mean we have to show them in the > documentation. These were already left out of the main list, but a > reference in the main manpage was left, so remove that.
Yeah, that reference was added by me to try to be thorough, but I think mentioning ssh:// (as you do here) accomplishes the same goal in a better way.
> Also add a note to discourage their use if anybody goes looking for them > in the source code.
Sounds like a good plan.
Show 15 quoted lines
> diff --git a/transport.c b/transport.c
> index 9ae7184..f5ae707 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -1002,6 +1002,10 @@ struct transport *transport_get(struct remote *remote, const char *url)
> || starts_with(url, "file://")
> || starts_with(url, "git://")
> || starts_with(url, "ssh://")
> + /*
> + * These ssh schemes remain supported for compat but are
> + * undocumented and their use is discouraged
> + */
> || starts_with(url, "git+ssh://")
> || starts_with(url, "ssh+git://")) {
> /*Breaking apart an ||-chain with a comment like this is a little odd, but I think the result is reasonably readable, so it's probably OK.
The rest of the patch is obviously correct. Thanks for following up on the earlier discussion.
-Peff