git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Kastrup <dak@gnu.org>, Jakub Narebski <jnareb@gmail.com>,
	git@vger.kernel.org
Subject: Re: remote#branch
Date: Wed, 31 Oct 2007 16:47:29 -0400	[thread overview]
Message-ID: <20071031204729.GB13300@coredump.intra.peff.net> (raw)
In-Reply-To: <alpine.LFD.0.999.0710310816180.30120@woody.linux-foundation.org>

On Wed, Oct 31, 2007 at 08:28:36AM -0700, Linus Torvalds wrote:

> Because we don't care! This is *exactly* why I brought up the whole 
> discussion about "interoperability with a web browser", and pointed out 
> that there is no such thing *anyway*, since a GIT URL is generally not 
> suitable for browsing _regardless_ of any encoding issues!
> 
> So it doesn't matter one whit if a mail client recognizes GIT URL's or 
> not! Because the mail client cannot do the right thing with them anyway, 
> and would generally think that it's something that it should highlight so 
> that you can browse it!

Two points:

 1. Just because _your_ mail client can't do anything useful with git
    URLs^H^H^H^H repo specifications, doesn't mean that others can't.

 2. You are conflating syntax and semantics. Think of the task I
    mentioned as two subtasks: pulling the location specifier from the
    email, and then doing something useful with it (in this case,
    git-cloning it it). The first subtask depends _only_ on a parseable
    syntax. The user can provide the context necessary for accomplishing
    the second subtask.

For example, consider a terminal that, upon pressing some keyboard
combination, will highlight the first URL-ish looking blob on the
screen, prompt you for a command, and then execute '$command $url'.  The
terminal doesn't have to know the semantics of the blob, but it has to
know the syntax. The user provides the semantics.

And yes, such a terminal exists, and I'm using it right now.

> Besides, you generally shouldn't use http for git URL's in the first 
> place, and they are very much a secondary citizen. Yes, some people use 
> them because they have firewall issues, and they *work*, but giving them 
> as examples of GIT URL's and discussing them as it they were a big deal is 
> just *stupid* when no other - more realistic - git url works that way 
> anyway.

The example above is equally applicable to git:// URLs. As it is to
host:path specifiers, although obviously that is a syntax that the
highlighter would have to recognize. But the point is that by following
established syntaxes, you don't have to write a git-repo-specifier
syntax parser; it comes for free (and isn't that, after all, the entire
_point_ of URLs?).

> This was the whole and only point of my "interoperability" thing. The GIT 
> URL's - even when they are perfectly well-formed URL's (which is basically 
> 100% of the time, since no current git server tends to put things like 
> spaces in the path anyway) - are simply in a different "space" than most 
> other URL's.

Sure, you need context to use them correctly. But that doesn't
necessarily mean you should just give up on the syntax part. I would
rather the computer do half of the task and let me finish it than make
me do the whole thing.

> You cannot feed them to a web browser or a file browser anyway, since the 
> URL is actually mal-formed (on purpose) in *another* and more fundamental 
> way: it doesn't say what the "application domain" is, since it basically 
> just assumes that the application domain is git, and the "scheme" part of 
> the URL really talks only about the _protocol_, not about the fact that 
> it's a git thing.
> 
> So if you wanted to be inter-operable, you'd have add the "git" part to 
> the scheme, and do the (insane, in my opinion) cogito thing with 
> "git+http://xyz.hjashja/" thing!

Yes, if you did that, you could automate _both_ parts of the task. But
again, that doesn't mean there isn't value to automating the first part
But that aside, even git+http doesn't solve all of your problems,
because it doesn't say _what_ you want to do with the location. Web
browsers just assume you want to fetch and view a location. But other
tools which accept URLs might perform _other_ actions on a given
location. So URLs really are a "subject" that can be operated on. It's
just that we are most accustomed to seeing them used by the "retrieve
this and display it" tool.

>  - the only way to make git interoperate would be to be user-UNfriendly 
>    with stupid markers that no git program really needs or wants, and by 
>    making the escaping depend on the form of the GIT URL.

Some git specifiers clearly look like URLs. Why not accept URL encoding
for them? And if there are characters that _should_ have been encoded by
URL encoding standards, treat them as if they had been encoded (i.e.,
handing 'http://foo.tld/repo with space' would be treated the same as
'http://foo.tld/repo%20with%20space'). This means that most unencoded
repos will behave exactly the same, but we are more liberal in wht we
accept. The exception is that repos with a '%' in the specifier will
parse differently (i.e., if you actually had a repo with the literal
characters '%20' in it, it will no parse).

Yes, this means that if you have a bizarre repo name, you can't
necessarily switch between host:file syntax and git:// syntax by simple
cut and paste. But you really can't _anyway_, since there is no
guarantee that they are rooted at the same location, or have the same
view of the filesystem.

> Personally, I think it's a much better idea to just be git-specific. 

Then why in the world did you choose a specifier syntax that looks
_exactly_ like a URL?

-Peff

  reply	other threads:[~2007-10-31 20:47 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 21:38 [PATCH] Git homepage: remove all the references to Cogito Paolo Ciarrocchi
2007-10-16  2:19 ` Petr Baudis
2007-10-16  7:50   ` Matthieu Moy
2007-10-16  8:01     ` Paolo Ciarrocchi
2007-10-16  9:04     ` [PATCH] gitweb: Speed up get_projects_list for large source trees Luke Lu
2007-10-16 16:55       ` Andreas Ericsson
2007-10-16 23:20       ` Petr Baudis
2007-10-16 10:49   ` cogito and remote#branch, was Re: [PATCH] Git homepage: remove all the references to Cogito Johannes Schindelin
2007-10-16 21:09     ` remote#branch Jan Hudec
2007-10-16 21:35       ` remote#branch Johannes Schindelin
2007-10-27 20:47         ` remote#branch Jan Hudec
2007-10-27 23:01           ` remote#branch Johannes Schindelin
2007-10-29 17:40             ` remote#branch Jan Hudec
2007-10-29 18:17               ` remote#branch Linus Torvalds
2007-10-29 21:49                 ` remote#branch Theodore Tso
2007-10-29 22:57                   ` remote#branch Linus Torvalds
2007-10-29 23:49                     ` remote#branch Johannes Schindelin
2007-10-30  3:01                     ` remote#branch Theodore Tso
2007-10-30  3:40                       ` remote#branch Junio C Hamano
2007-10-30  4:40                         ` remote#branch Theodore Tso
2007-10-30  4:51                           ` remote#branch Linus Torvalds
2007-10-30  5:37                             ` remote#branch Tom Prince
2007-10-30 14:59                               ` remote#branch Linus Torvalds
2007-10-30 16:02                                 ` remote#branch Tom Prince
2007-10-30 17:39                                   ` remote#branch Linus Torvalds
2007-10-30 17:49                                     ` remote#branch Matthieu Moy
2007-10-30 17:58                                       ` remote#branch Linus Torvalds
2007-10-30 18:19                                         ` remote#branch Linus Torvalds
2007-10-30 19:18                                         ` remote#branch Pascal Obry
2007-10-30 19:38                                           ` remote#branch Linus Torvalds
2007-10-30 20:15                                             ` remote#branch Randal L. Schwartz
2007-10-30 20:30                                               ` remote#branch Linus Torvalds
2007-10-30 20:36                                               ` remote#branch Nicolas Pitre
2007-10-30 23:58                                             ` remote#branch Jeff King
2007-10-31  0:12                                               ` remote#branch Jakub Narebski
2007-10-31  1:38                                                 ` remote#branch Jeff King
2007-10-31  1:49                                                   ` remote#branch Jakub Narebski
2007-10-31  1:57                                                     ` remote#branch Jeff King
2007-10-31  7:09                                                       ` remote#branch Andreas Ericsson
2007-10-31  8:35                                                         ` remote#branch Mike Hommey
2007-10-31  9:03                                                           ` remote#branch Andreas Ericsson
2007-10-31  9:15                                                             ` remote#branch Mike Hommey
2007-11-01  0:22                                                               ` remote#branch Jakub Narebski
2007-11-01  5:11                                                                 ` remote#branch Theodore Tso
2007-11-01  7:29                                                               ` remote#branch Andreas Ericsson
2007-10-31  9:33                                                       ` remote#branch Pascal Obry
2007-10-31  6:42                                                 ` remote#branch David Kastrup
2007-10-31 15:28                                                   ` remote#branch Linus Torvalds
2007-10-31 20:47                                                     ` Jeff King [this message]
2007-10-31 21:01                                                       ` remote#branch Linus Torvalds
2007-10-31 21:26                                                         ` remote#branch Jeff King
2007-10-31 21:28                                                         ` remote#branch Linus Torvalds
2007-10-31 21:07                                                       ` remote#branch Andreas Ericsson
2007-10-31 21:31                                                         ` remote#branch Jeff King
2007-10-31  6:39                                               ` remote#branch David Kastrup
2007-10-31  8:16                                                 ` remote#branch Wincent Colaiuta
2007-10-31  8:25                                                 ` remote#branch Robin Rosenberg
2007-10-31  9:34                                                 ` remote#branch Pascal Obry
2007-10-31 17:13                                               ` remote#branch Petr Baudis
2007-10-30 19:15                                     ` remote#branch Pascal Obry
2007-10-30 19:36                                 ` remote#branch Jan Hudec
2007-10-30 19:53                                   ` remote#branch Linus Torvalds
2007-10-31 19:29                                   ` remote#branch Erik Warendorph
2007-10-30 10:02                             ` remote#branch Johannes Schindelin
2007-10-31  0:41                             ` remote#branch Martin Langhoff
2007-10-31  0:59                               ` remote#branch Linus Torvalds
2007-10-31  1:43                               ` remote#branch Jeff King
2007-10-31  1:49                                 ` remote#branch Martin Langhoff
2007-10-31  1:59                                   ` remote#branch Jeff King
2007-10-31  3:08                                 ` remote#branch Johannes Schindelin
2007-10-30  4:50                       ` remote#branch Linus Torvalds
2007-10-29 18:32               ` remote#branch Johannes Schindelin
2007-10-16 22:16     ` cogito and remote#branch, was Re: [PATCH] Git homepage: remove all the references to Cogito Jonas Fonseca
2007-10-31 17:09       ` Petr Baudis
2007-10-31 21:17         ` Jonas Fonseca

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=20071031204729.GB13300@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=dak@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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).