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

Re: [PATCH] git-remote: support remotes with a dot in the name

From
Junio C Hamano <junkio@cox.net>
Date
Feb 21, 2007, 06:18 UTC
Message-ID
<7vfy90t4mo.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070221004631.q4npyww808k88s0o@webmail.spamcop.net>
Pavel Roskin <proski@gnu.org> writes:
> On the other hand, I've been tracking "wireless-2.6" for months without even
> realizing that the name could be a problem.

Ah, sorry. You are absolutely right. Using wireless-2.6 to name wireless-2.6 repository (or linux-2.6 to name linux-2.6 repository) makes perfect sense.

Show 15 quoted lines
>> I do not strongly oppose to allowing it now, but I suspect this
>> is probably less impact:
>>
>> 	if (/^remote\.(\S+?)\.([^.\s]+)\s+(.*)$/) {
>>         	...
>> 	}
>>
>> With this, we disallow whitespaces in remote names, but we leave
>> the door open for supporting variables other than fetch and url
>> by accepting the third token that matches any sequence of
>> non-dot, non-whitespace letters.
>
> It would be great as long as we don't use names with more than
> one dot after the remote name
> (e.g. remote.wireless-2.6.url.push),...
Do you mean:
	[remote "wireless-2.6.url"]
		url = wire.less:/repo/sito/ry.git
        	fetch = +refs/heads/*:refs/remotes/wireless-2.6.url/*

If so I think my replacement would match it. It will be returned from "git config --get-regexp '^remote\.'" like this:

remote.wireless-2.6.url.url wire.less:/repo/sito/ry.git remote.wireless-2.6.url.fetch +refs/heads/*:refs/remotes/wireless-2.6.url/*

and in:
 	/^remote\.(\S+?)\.([^.\s]+)\s+(.*)$/

$1 would match shortest non-whitespace sequence after "remote.", $2 would match longuest non-dot, non-whitespace sequence before a sequence of whitespaces, and $3 would match everything after that sequence of whitespaces.

So, $1 = "wireless-2.6.url", $2 = "url", $3 = "wire.less:/repo/sito/ry.git" or $1 = "wireless-2.6.url", $2 = "fetch", $3 = "+refs/heads/...."

But my Perl is rusty, so please double check it.
Previous: Pavel RoskinNext: Pavel Roskin
Message 4 of 8 in “git-remote: support remotes with a dot in the name”
  1. git-remote: support remotes with a dot in the namePavel Roskin, Feb 21, 2007
  2. Junio C HamanoFeb 21, 2007
  3. Pavel RoskinFeb 21, 2007
  4. Junio C HamanoFeb 21, 2007
  5. Pavel RoskinFeb 21, 2007
  6. Shawn O. PearceFeb 21, 2007
  7. Junio C HamanoFeb 21, 2007
  8. Theodore TsoFeb 21, 2007

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.