Re: [PATCH] Add support for host aliases in config files

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

 



On Fri, 25 Jan 2008, Jakub Narebski wrote:

> On Friday, 25 January 2008, Daniel Barkalow wrote:
> > On Fri, 25 Jan 2008, Jakub Narebski wrote:
> >> Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
> >> 
> >>> This allows users with different preferences for access methods to the
> >>> same remote repositories to rewrite each other's URLs to get the
> >>> desired access.
> >> 
> >> [...]
> >>> +host.<name>.base::
> >>> +	The base URL which should be used for this particular
> >>> +	host. This can be used by a user who has a better access
> >>> +	method to a repository than other users to make use of the
> >>> +	preferable path despite getting URLs from other users using
> >>> +	more commonly-available methods. Alternatively, a user who
> >>> +	only has less privileged access to a repository than the usual
> >>> +	audience can use this mechanism to replace disallowed methods
> >>> +	with public ones.
> >>> +
> >>> +host.<name>.alias::
> >>> +	Additional base URLs which refer to this host. If a URL
> >>> +	matches this, any access to it will use the URL formed with
> >>> +	the corresponding base URL instead of the given URL.
> >>> +
> >> 
> >> From this I could not get how those configuration are meant to be
> >> used. Perhaps some usage example?
> > 
> > [host "kernel"]
> >         base = git://git.kernel.org/pub/
> >         alias = git+ssh://master.kernel.org/pub/
> >         alias = master.kernel.org:/pub/
> > 
> >> BTW. wouldn't the same be solved better by enabling remote.<name>.url
> >> to be multi-valued, first working for fetch, all URLs for push?
> 
> Ah, thanks. I have misunderstood the above description (hint, hint!)...

Yup, that's why I need to talk it through. It made perfect sense to me, 
but I'd had the problem in the first place and wrote the code...

> > The real point is actually for when you're dealing with URLs on the 
> > command line which you've cut-and-paste from email or other things. For 
> > example, the patches in the -mm quilt series say where the git trees are, 
> > but they're all like 
> > "git+ssh://master.kernel.org/pub/scm/linux/kernel/git/dtor/input.git", 
> > which is ideal for people (like Andrew) who have accounts on master, but 
> > requires manual fixing for people (like me) who don't.
> > 
> > With the above config, I can do:
> > 
> > git fetch git+ssh://master.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
> 
> Couldn't you just configure "kernel" remote, and use "git fetch kernel"
> instead?

Note the .../dtor/input.git at the end. There are another 50-odd different 
URLs in -mm that start git+ssh://master.kernel.org/pub/ where I have to 
use git://git.kernel.org/pub/ instead, and it's not a fixed set.

> > and it actually fetches
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
> >
> > which actually works for me.
> 
> So this config variable is actually about _rewriting_ URLs, rather than
> having multiple _alternate_ URLs to fetch from. IMHO either the
> documentation above should be (re)written better (there is time, as we
> are in feature freeze), or the example mentioned above should be added
> (but where?).

Maybe we should have a "host.<name>.*" section that explains the 
collection of configuration options as a group? Like:

----------
host.<name>.*::
	These options provide a way to rewrite URLs when there is a
	pattern of URLs with a common prefix which should be replaced
	with a different prefix. For every 'alias' prefix given, any
	URL git receives that starts with that prefix will be
	rewritten to have the 'base' prefix instead. In cases where
	some site serves a large number of repositories, and serves
	them with multiple access methods, and some users need to use
	different access methods, this feature allows people to
	specify any of the equivalent URLs and have git automatically
	rewrite the URL to the best alternative for the particular
	user, even for a never-before-seen repository on the site.

host.<name>.base::
	The base URL which should be used for this particular
	host.

host.<name>.alias::
	Additional base URLs which refer to this host. If a URL
	matches this, any access to it will use the URL formed with
	the corresponding base URL instead of the given URL.
----------

	-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux