Re: remote#branch

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: David Kastrup <dak@...>, Jakub Narebski <jnareb@...>, <git@...>
Date: Wednesday, October 31, 2007 - 4:47 pm

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


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.


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?).


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.


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.


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.


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

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: remote#branch, Jakub Narebski, (Tue Oct 30, 8:12 pm)
Re: remote#branch, David Kastrup, (Wed Oct 31, 2:42 am)
Re: remote#branch, Linus Torvalds, (Wed Oct 31, 11:28 am)
Re: remote#branch, Jeff King, (Wed Oct 31, 4:47 pm)
Re: remote#branch, Andreas Ericsson, (Wed Oct 31, 5:07 pm)
Re: remote#branch, Jeff King, (Wed Oct 31, 5:31 pm)
Re: remote#branch, Linus Torvalds, (Wed Oct 31, 5:01 pm)
Re: remote#branch, Linus Torvalds, (Wed Oct 31, 5:28 pm)
Re: remote#branch, Jeff King, (Wed Oct 31, 5:26 pm)
Re: remote#branch, Jeff King, (Tue Oct 30, 9:38 pm)
Re: remote#branch, Jakub Narebski, (Tue Oct 30, 9:49 pm)
Re: remote#branch, Jeff King, (Tue Oct 30, 9:57 pm)
Re: remote#branch, Pascal Obry, (Wed Oct 31, 5:33 am)
Re: remote#branch, Andreas Ericsson, (Wed Oct 31, 3:09 am)
Re: remote#branch, Mike Hommey, (Wed Oct 31, 4:35 am)
Re: remote#branch, Andreas Ericsson, (Wed Oct 31, 5:03 am)
Re: remote#branch, Mike Hommey, (Wed Oct 31, 5:15 am)
Re: remote#branch, Andreas Ericsson, (Thu Nov 1, 3:29 am)
Re: remote#branch, Jakub Narebski, (Wed Oct 31, 8:22 pm)
Re: remote#branch, Theodore Tso, (Thu Nov 1, 1:11 am)