[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Git URLs (was Re: Bug#654958: debian-policy: Document VCS fields.)



Le Sun, Jan 08, 2012 at 11:42:00AM -0600, Jonathan Nieder a écrit :
> 
> Git URLs deliberately represent a repository, not a branch.  That is
> because branches and repositories for a package are simply different
> notions in git (unlike in Subversion, where they are both described by
> a path relative to the root of a repository shared by multiple
> packages).  This is not specific to Git but is a feature shared by
> CVS, for example.
> 
> To represent a branch in a remote repository, one generally uses a Git
> URL, followed by a space, followed by the branch name.  This is the
> syntax accepted by "git pull":
> 
> 	git pull git://git.example.com/path/to/repo for-charles

One could say similarly that directories and files are not the same notion in
web sites, yet HTTP URLs are able to contain both.  In the end, it is just a
matter of putting all the information in a single string, with the advantage
that one can then turn it in a URL.  Although very ugly, the following URLs
(before and after URL encoding) would satisfy this:

  git://git.example.com/path/to/repo for-charles
  git://git.example.com/path/to/repo%20for-charles

I hope that a better solution can be found, and that in the future, some git
commands will accept (with the help of appropriate servers) URLs similarly to
svn log URL, svn diff URL1 URL2, etc.

But this is getting off-topic (therefore not CCing #654958).

Cheers,

-- 
Charles Plessy
Tsurumi, Kanagawa, Japan


Reply to: