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

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

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 21, 2008, 05:04 UTC
Message-ID
<alpine.LNX.1.00.0802202351400.19024@iabervon.org>
In-Reply-To
<alpine.LFD.1.00.0802201735030.7833@woody.linux-foundation.org>
On Wed, 20 Feb 2008, Linus Torvalds wrote:
Show 57 quoted lines
> On Wed, 20 Feb 2008, Jay Soffian wrote:
> 
> > On Wed, Feb 20, 2008 at 7:47 PM, Junio C Hamano <gitster@pobox.com> wrote:
> > >
> > >  In either case, I think a good approach to take is to find a
> > >  wording that conveys the notion "I will use A to mean what some
> > >  other people might call B or C" unambiguously.
> > 
> > [url A]
> >   other_people_call_it = B
> >   other_people_call_it = C
> > 
> > [local_url A]
> >   external_url = B
> >   external_url = C
> 
> Well, realistically, what's really the use of this?
> 
> The only really sane use of this is the one that Daniel started out with: 
> you may have a "external" representation of a name, but for your own 
> purely local configuration reasons, you may want to map that name into 
> another one that works for you.
> 
> The reason may be some local protocol issue: let's say that you see all 
> these pointers to git://git.kernel.org/ flying around, because that is the 
> official home of the git repository itself, but you work at a company that 
> has a firewall that doesn't let git through. So you want to still *use* 
> those names that other people use, but you want to remap them through some 
> proxy server (or a local cache), or just to use ssh instead.
> 
> So it's generally *not* that it's an "alias" for another site, since it 
> isn't that in general - it may just be a very local configuration thing. 
> It's also not really that you would call it one thing and others would 
> call it another thing: you want to call it the *same* thing as others call 
> it, but you want to work around some specific site issue (or just use a 
> cache that is closer without having to think about it).
> 
> So I think it really boils down to the fact that you want to "rewrite" the 
> thing. Not aliases, not "also known as", but you're logically really 
> looking for something like 
> 
> 	[access "git://git.kernel.org/*"]
> 		proxy = proxy-program
> 		url = "ssh://master.kernel.org/*"
> 
> which admittedly looks rather strange too, but at the same time it does 
> make sense from a "what do we really want to do?" standpoint.
> 
> Of course, in this case Daniel didn't actually do that "proxy" part, but I 
> think the argument that we should try to make the config file syntax 
> describe what the user wants to do is still very true. So skip that 
> "proxy" part (maybe somebody wants to do that too some day), and leave the 
> 
> 	[access "original"]
> 		url = "rewritten"
> 
> kind of syntax.
I think it has to be:
	[something "rewritten"]
		something = "original"
		something = "other original"

Because you want to be able to take multiple "original"s for the same result in order to avoid duplicating that part (and leading to skew if you decide to change). But I like the idea of basing the naming on the rewriting operation rather than the relationship. Maybe:

[url "rewritten"]
	insteadOf = "original"
	-Daniel
*This .sig left intentionally blank*
Previous: Jay SoffianNext: Junio C Hamano
Message 13 of 22 in “Add support for url aliases in config files”
  1. 2/2 Add support for url aliases in config filesDaniel Barkalow, Feb 20, 2008
  2. Junio C HamanoFeb 20, 2008
  3. Daniel BarkalowFeb 20, 2008
  4. Junio C HamanoFeb 20, 2008
  5. Jay SoffianFeb 20, 2008
  6. Daniel BarkalowFeb 20, 2008
  7. しらいしななこFeb 20, 2008
  8. Johannes SchindelinFeb 20, 2008
  9. Junio C HamanoFeb 21, 2008
  10. Jay SoffianFeb 21, 2008
  11. Linus TorvaldsFeb 21, 2008
  12. Jay SoffianFeb 21, 2008
  13. Daniel BarkalowFeb 21, 2008
  14. Junio C HamanoFeb 21, 2008
  15. Junio C HamanoFeb 25, 2008
  16. Daniel BarkalowFeb 25, 2008
  17. Junio C HamanoFeb 25, 2008
  18. Daniel BarkalowFeb 25, 2008
  19. Jon LoeligerFeb 21, 2008
  20. Jay SoffianFeb 20, 2008
  21. Junio C HamanoFeb 20, 2008
  22. Jay SoffianFeb 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.