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 20, 2008, 20:42 UTC
Message-ID
<alpine.LNX.1.00.0802201520450.19024@iabervon.org>
In-Reply-To
<7vskzn4dpz.fsf@gitster.siamese.dyndns.org>
On Wed, 20 Feb 2008, Junio C Hamano wrote:
Show 25 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > On Wed, 20 Feb 2008, Junio C Hamano wrote:
> > ...
> >> To me, "url.$this_is_what_I_use.aka = $how_they_might_call_it"
> >> initially felt backwards, but the point of the facility is to
> >> allow mapping many ways other people might call it to how you
> >> would (and the other way would not make sense as allowing to map
> >> one thing to multiple is only to introduce unnecessary
> >> ambiguity), so it makes perfect sense.
> >
> > This order of values is definitely the right thing, for the mapping 
> > reasons you saw. And I think "aka" is generally used to indicate 
> > additional non-canonical names for something with an official name (see, 
> > for example, IMDB's usage). I haven't been able to come up with anything 
> > better to indicate "this is a name that I will recognize but not use 
> > myself".
> 
> Yeah, that "aka" is still disturbing.
> 
> 	[url A]
>         	aka = B
> 
> would read to me: "A is also known as B" but that is clearly not
> what it means here. 

But it is; the thing which we will call "A" is also known (and sometimes called by other people, or us speaking informally) as "B".

Show 9 quoted lines
> You would want this:
> 
> 	[url A]
>         	aka = B 
> 		aka = C
> 
> to mean "B is also known as A.  C is also known as A."  IOW, you
> are using it backwards, because their name is more official and
> you are using your own unofficial name to call it.

No, "A" is the *real* name, the one that actually works. B and C are pseudonyms, of which there may be multiple, both from more "official" (but git is decentralized, and doesn't care for officialness) and less official sources.

I think you're seeing this feature as taking "correct" URLs and rewriting them to be local aliases, when the only thing that makes sense for a system like git is really to say that whatever URL works for us is "correct", and everybody else is speaking their own local dialect.

In fact, one case I anticipate using extensively is:
[url "git://iabervon.org/~barkalow/"]
	aka = ":"

Such that, once clone is using remote.{c,h}, "git clone :git" would clone my home git repository. Obviously ":" isn't the real name in this rewriting.

Show 23 quoted lines
> >> > diff --git a/Documentation/urls.txt b/Documentation/urls.txt
> >> > index 81ac17f..0115af7 100644
> >> > --- a/Documentation/urls.txt
> >> > +++ b/Documentation/urls.txt
> >> > @@ -44,3 +44,26 @@ endif::git-clone[]
> >> > ...
> >> > +If you have a section:
> >> > +
> >> > +------------
> >> > +	[host "git://git.host.xz/"]
> >> > +		aka = host.xz:/path/to/
> >> > +		aka = work:
> >> > +------------
> >> > +
> >> > +a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
> >> > +rewritten in any context that takes a URL to be
> >> > +"git://git.host.xz/repo.git".
> >> 
> >> This still stands???
> >
> > And missed the "host"->"url" bit while I fixed the rest of the example. 
> 
> So this part is not wanted, right?

The first part (not quoted) is not wanted (it was left over from when I combined the three entries into one and moved it under 'u' instead of 'h'). This part *is* wanted, but should say:

+	[url "git://git.host.xz/"]
instead of
+	[host "git://git.host.xz/"]
since I changed the option name.
	-Daniel
*This .sig left intentionally blank*
Previous: Jay SoffianNext: しらいしななこ
Message 6 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.