{"thread":{"id":"6904","subject":"[PATCH] git-remote: support remotes with a dot in the name","startedAt":"2007-02-21T05:03:36Z","lastAt":"2007-02-21T10:21:11Z","messageCount":8,"participants":["Pavel Roskin","Junio C Hamano","Shawn O. Pearce","Theodore Tso"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35157","messageId":"20070221050336.26431.46485.stgit@dv.roinet.com","threadId":"6904","inReplyTo":null,"subject":"[PATCH] git-remote: support remotes with a dot in the name","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-21T05:03:36Z","receivedAt":"2007-02-21T05:03:36Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Ignore configuration data other that \"url\" and \"fetch\" for the remote. \nWe cannot process it to extract the remote name from it reliably. \nBesides, a remote without \"url\" is currently invalid, so we are not\nmissing anything.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n git-remote.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-remote.perl b/git-remote.perl\nindex 6e473ec..97b5f6c 100755\n--- a/git-remote.perl\n+++ b/git-remote.perl\n@@ -67,7 +67,7 @@ sub list_remote {\n \t\t$git->command(qw(config --get-regexp), '^remote\\.');\n \t};\n \tfor (@remotes) {\n-\t\tif (/^remote\\.([^.]*)\\.(\\S*)\\s+(.*)$/) {\n+\t\tif (/^remote\\.(\\S*)\\.(fetch|url)\\s+(.*)$/) {\n \t\t\tadd_remote_config(\\%seen, $1, $2, $3);\n \t\t}\n \t}\n"},{"id":"35158","messageId":"7vwt2ct79x.fsf@assigned-by-dhcp.cox.net","threadId":"6904","inReplyTo":"20070221050336.26431.46485.stgit@dv.roinet.com","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-21T05:21:46Z","receivedAt":"2007-02-21T05:21:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> Ignore configuration data other that \"url\" and \"fetch\" for the remote. \n> We cannot process it to extract the remote name from it reliably. \n> Besides, a remote without \"url\" is currently invalid, so we are not\n> missing anything.\n>\n> Signed-off-by: Pavel Roskin <proski@gnu.org>\n\nI do not think we ever officially \"supported\" remotes with a dot\nin their names since $GIT_DIR/remotes/ or $GIT_DIR/branches\ndays.  \n\n>  \tfor (@remotes) {\n> -\t\tif (/^remote\\.([^.]*)\\.(\\S*)\\s+(.*)$/) {\n> +\t\tif (/^remote\\.(\\S*)\\.(fetch|url)\\s+(.*)$/) {\n>  \t\t\tadd_remote_config(\\%seen, $1, $2, $3);\n>  \t\t}\n\nI do not strongly oppose to allowing it now, but I suspect this\nis probably less impact:\n\n\tif (/^remote\\.(\\S+?)\\.([^.\\s]+)\\s+(.*)$/) {\n        \t...\n\t}\n\nWith this, we disallow whitespaces in remote names, but we leave\nthe door open for supporting variables other than fetch and url\nby accepting the third token that matches any sequence of\nnon-dot, non-whitespace letters.\n"},{"id":"35160","messageId":"20070221004631.q4npyww808k88s0o@webmail.spamcop.net","threadId":"6904","inReplyTo":"7vwt2ct79x.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-21T05:46:31Z","receivedAt":"2007-02-21T05:46:31Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Quoting Junio C Hamano <junkio@cox.net>:\n\n> I do not think we ever officially \"supported\" remotes with a dot\n> in their names since $GIT_DIR/remotes/ or $GIT_DIR/branches\n> days.\n\nOn the other hand, I've been tracking \"wireless-2.6\" for months without even\nrealizing that the name could be a problem.  It is only when I tried the new\n\"git-remote update\" that I noticed that it tries to update \"wireless-2\" and\nfails.\n\n> I do not strongly oppose to allowing it now, but I suspect this\n> is probably less impact:\n>\n> \tif (/^remote\\.(\\S+?)\\.([^.\\s]+)\\s+(.*)$/) {\n>         \t...\n> \t}\n>\n> With this, we disallow whitespaces in remote names, but we leave\n> the door open for supporting variables other than fetch and url\n> by accepting the third token that matches any sequence of\n> non-dot, non-whitespace letters.\n\nIt would be great as long as we don't use names with more than one dot after the\nremote name (e.g. remote.wireless-2.6.url.push), but if you think it's unlikely,\nI agree that your code is better.\n\n--\nRegards,\nPavel Roskin\n"},{"id":"35163","messageId":"7vfy90t4mo.fsf@assigned-by-dhcp.cox.net","threadId":"6904","inReplyTo":"20070221004631.q4npyww808k88s0o@webmail.spamcop.net","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-21T06:18:55Z","receivedAt":"2007-02-21T06:18:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> On the other hand, I've been tracking \"wireless-2.6\" for months without even\n> realizing that the name could be a problem.\n\nAh, sorry.  You are absolutely right.  Using wireless-2.6 to\nname wireless-2.6 repository (or linux-2.6 to name linux-2.6\nrepository) makes perfect sense.\n\n>> I do not strongly oppose to allowing it now, but I suspect this\n>> is probably less impact:\n>>\n>> \tif (/^remote\\.(\\S+?)\\.([^.\\s]+)\\s+(.*)$/) {\n>>         \t...\n>> \t}\n>>\n>> With this, we disallow whitespaces in remote names, but we leave\n>> the door open for supporting variables other than fetch and url\n>> by accepting the third token that matches any sequence of\n>> non-dot, non-whitespace letters.\n>\n> It would be great as long as we don't use names with more than\n> one dot after the remote name\n> (e.g. remote.wireless-2.6.url.push),...\n\nDo you mean:\n\n\t[remote \"wireless-2.6.url\"]\n\t\turl = wire.less:/repo/sito/ry.git\n        \tfetch = +refs/heads/*:refs/remotes/wireless-2.6.url/*\n\nIf so I think my replacement would match it.  It will be\nreturned from \"git config --get-regexp '^remote\\.'\"  like this:\n\nremote.wireless-2.6.url.url wire.less:/repo/sito/ry.git\nremote.wireless-2.6.url.fetch +refs/heads/*:refs/remotes/wireless-2.6.url/*\n\nand in:\n\n \t/^remote\\.(\\S+?)\\.([^.\\s]+)\\s+(.*)$/\n\n$1 would match shortest non-whitespace sequence after \"remote.\",\n$2 would match longuest non-dot, non-whitespace sequence before\na sequence of whitespaces, and\n$3 would match everything after that sequence of whitespaces.\n\nSo, $1 = \"wireless-2.6.url\", $2 = \"url\", $3 = \"wire.less:/repo/sito/ry.git\"\nor $1 = \"wireless-2.6.url\", $2 = \"fetch\", $3 = \"+refs/heads/....\"\n\nBut my Perl is rusty, so please double check it.\n"},{"id":"35165","messageId":"20070221021206.8onspw0840gcs8ck@webmail.spamcop.net","threadId":"6904","inReplyTo":"7vfy90t4mo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-21T07:12:06Z","receivedAt":"2007-02-21T07:12:06Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Quoting Junio C Hamano <junkio@cox.net>:\n\n> Do you mean:\n>\n> \t[remote \"wireless-2.6.url\"]\n> \t\turl = wire.less:/repo/sito/ry.git\n>         \tfetch = +refs/heads/*:refs/remotes/wireless-2.6.url/*\n\nI was thinking of something like\n\n[remote \"wireless-2.6\"]\nurl = http://foo/bar\nurl.push = ssh://foo/bar\n\nBut I think it's quite unlikely to be named like that.\n\n> But my Perl is rusty, so please double check it.\n\nThe \"(\\S*?)\" construct looks weird (you probably meant to use \"(\\S*)\" for the\nremote name), but the rest is probably OK.  I'll send the \"double-checked\"\npatch tomorrow unless you beat me at that.\n\n--\nRegards,\nPavel Roskin\n"},{"id":"35166","messageId":"20070221072921.GB28152@spearce.org","threadId":"6904","inReplyTo":"20070221021206.8onspw0840gcs8ck@webmail.spamcop.net","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-21T07:29:21Z","receivedAt":"2007-02-21T07:29:21Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Pavel Roskin <proski@gnu.org> wrote:\n> I was thinking of something like\n> \n> [remote \"wireless-2.6\"]\n> url = http://foo/bar\n> url.push = ssh://foo/bar\n\nThe key `url.push` is not a valid string in a config file.\n \n> > But my Perl is rusty, so please double check it.\n\nFWIW Junio's pattern looks OK to me.\n\n> The \"(\\S*?)\" construct looks weird (you probably meant to use \"(\\S*)\" for the\n> remote name), but the rest is probably OK.  I'll send the \"double-checked\"\n> patch tomorrow unless you beat me at that.\n\nThe use of (\\S+?) here is right.  We want to be non-greedy in our\nmatching of the remote name, as we don't want to overslurp and grab\nthrough the key name and part of the key value into the remote name\nby mistake, especially if the key value contained spaces.\n\n-- \nShawn.\n"},{"id":"35167","messageId":"7vr6skrmo9.fsf@assigned-by-dhcp.cox.net","threadId":"6904","inReplyTo":"20070221021206.8onspw0840gcs8ck@webmail.spamcop.net","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-21T07:32:06Z","receivedAt":"2007-02-21T07:32:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> I was thinking of something like\n>\n> [remote \"wireless-2.6\"]\n> url = http://foo/bar\n> url.push = ssh://foo/bar\n\nAhh.\n\nI was not taking the above use case into account when I wrote\nthat regexp, because I do not think we ever supported (nor were\nplanning to ever support) names with dot at the third level.\n\n> But I think it's quite unlikely to be named like that.\n\nThe second level (\"wireless-2.6\") is designed to be more lenient\nto accept wider \"user level names\" for branches, remotes, etc.,\nbut the third level is for variable names the programs use, and\nit is not the question of likely/unlikely, but more about how we\n(as the git system builders, not the end users) want to name our\nvariables.  So I do not think it is not such a big deal if we do\nnot support \"url.push\" variable.\n\n>> But my Perl is rusty, so please double check it.\n>\n> The \"(\\S*?)\" construct looks weird (you probably meant to use \"(\\S*)\" for the\n> remote name), but the rest is probably OK.  I'll send the \"double-checked\"\n> patch tomorrow unless you beat me at that.\n\nActually I did mean to write \"*?\"; wasn't it how minimal match\nis written?\n"},{"id":"35172","messageId":"20070221102111.GB19825@thunk.org","threadId":"6904","inReplyTo":"7vfy90t4mo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-remote: support remotes with a dot in the name","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-02-21T10:21:11Z","receivedAt":"2007-02-21T10:21:11Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Tue, Feb 20, 2007 at 10:18:55PM -0800, Junio C Hamano wrote:\n> Do you mean:\n> \n> \t[remote \"wireless-2.6.url\"]\n> \t\turl = wire.less:/repo/sito/ry.git\n>         \tfetch = +refs/heads/*:refs/remotes/wireless-2.6.url/*\n\nOr even more likely:\n\n\t[remote \"stable-2.6.19\"]\n\t\turl = git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.19.y.git\n\t\tfetch = +refs/heads/*:refs/remotes/stable-2.6.19/*\n\n> If so I think my replacement would match it.  It will be\n> returned from \"git config --get-regexp '^remote\\.'\"  like this:\n> \n> remote.wireless-2.6.url.url wire.less:/repo/sito/ry.git\n> remote.wireless-2.6.url.fetch +refs/heads/*:refs/remotes/wireless-2.6.url/*\n> \n> and in:\n> \n>  \t/^remote\\.(\\S+?)\\.([^.\\s]+)\\s+(.*)$/\n> \n> $1 would match shortest non-whitespace sequence after \"remote.\",\n> $2 would match longuest non-dot, non-whitespace sequence before\n> a sequence of whitespaces, and\n> $3 would match everything after that sequence of whitespaces.\n> \n> So, $1 = \"wireless-2.6.url\", $2 = \"url\", $3 = \"wire.less:/repo/sito/ry.git\"\n> or $1 = \"wireless-2.6.url\", $2 = \"fetch\", $3 = \"+refs/heads/....\"\n> \n> But my Perl is rusty, so please double check it.\n\nYep, looks good to me.\n\n\t\t\t\t\t\t- Ted\n"}]}