git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 19, 2008, 16:45 UTC
Message-ID
<alpine.LNX.1.00.0802191127080.19024@iabervon.org>
In-Reply-To
<47BAF18F.5040709@freescale.com>
On Tue, 19 Feb 2008, Jon Loeliger wrote:
Show 33 quoted lines
> Daniel Barkalow wrote:
> > This allows users with different preferences for access methods to the
> > same remote repositories to rewrite each other's URLs by pattern
> > matching across a large set of similiarly set up repositories to each
> > get the desired access.
> > 
> > For example, if you don't have a kernel.org account, you might want
> > settings like:
> > 
> > [host "kernel.org"]
> >       base = git://git.kernel.org/pub/
> >       rewritebase = master.kernel.org:/pub
> > 
> > Then, if you give git a URL like:
> > 
> >   master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
> > 
> > it will act like you gave it:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
> > 
> > and you can cut-and-paste pull requests in email without fixing them
> > by hand, for example.
> > 
> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> > ---
> 
> So, I may be dense, but I'm having a hard time distinguishing
> the names "base" and "rewritebase" just from a User Interface
> perspective.  It's not clear to me which of those is the A and
> which is the B part in s/A/B/.  "Rewritebase" might be the "from"
> basis, or it might be the "to" basis.  Can we come up with more
> descriptive property names here?

rewritebase is the base you rewrite, which follows apache usage (which is where somebody got the term to suggest in an earlier round). It seems like it should be clear; am I obfuscating it by showing the options in the more backwards order in the examples? If you've got an idea that people find more clear, I'd be happy to change it (again).

> Is the rewrite always just prefix substitution/replacement?
> What if there was some generic path rewrite needed? (KISS? :-))

It's just prefix substitution. I suppose a future version could do something more clever (but it would probably also use variables named "pattern" instead of "base", so there shouldn't be any issues).

> Also, is "host" really the right config key?  Maybe "rewritehost"?
> Or is this thought to be the basis of other (perhaps not rewrite
> related) properties of the same host as well?

I think it's likely that other properties of the host could show up. I suspect that uploadpack and receivepack would be useful host-wide if you were using a lot of ad-hoc repository names on a big site. Rewriting the URLs is just the itch I had with this scope.

	-Daniel
*This .sig left intentionally blank*
Previous: Jakub NarebskiNext: Junio C Hamano
Message 6 of 11 in “Add support for host aliases in config files”
  1. 2/2 Add support for host aliases in config filesDaniel Barkalow, Feb 19, 2008
  2. Jon LoeligerFeb 19, 2008
  3. Johannes SchindelinFeb 19, 2008
  4. Daniel BarkalowFeb 19, 2008
  5. Jakub NarebskiFeb 20, 2008
  6. Daniel BarkalowFeb 19, 2008
  7. Junio C HamanoFeb 19, 2008
  8. Daniel BarkalowFeb 20, 2008
  9. Johannes SchindelinFeb 20, 2008
  10. Junio C HamanoFeb 20, 2008
  11. Johannes SchindelinFeb 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.