{"thread":{"id":"6968","subject":"git-remote and remotes with '.' in their names","startedAt":"2007-02-26T07:36:26Z","lastAt":"2007-02-28T15:14:15Z","messageCount":6,"participants":["Paul Collins","Jakub Narebski","Johannes Schindelin","Paolo Bonzini"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35493","messageId":"87k5y5tlol.fsf@briny.internal.ondioline.org","threadId":"6968","inReplyTo":null,"subject":"git-remote and remotes with '.' in their names","fromName":"Paul Collins","fromEmail":"paul@briny.ondioline.org","sentAt":"2007-02-26T07:36:26Z","receivedAt":"2007-02-26T07:36:26Z","isPatch":false,"sender":{"key":"paul@briny.ondioline.org","avatar":null},"body":"I just switched my remotes over to the git-remote way (which is very\nnice!) and was looking for a way to list all of the known remotes.\ngit-remote with no arguments almost does it, but I get the following:\n\n  [briny(linux-2.6)] git --version\n  git version 1.5.0.1\n  [briny(linux-2.6)] cat .git/config\n  [core]\n          repositoryformatversion = 0\n          filemode = true\n\n  [user]\n          email = \"paul@briny.ondioline.org\"\n  [remote \"origin\"]\n          url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n          fetch = +refs/heads/*:refs/remotes/origin/*\n  [remote \"wireless-dev\"]\n          url = git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-dev.git\n          fetch = +refs/heads/*:refs/remotes/wireless-dev/*\n  [remote \"stable-2.6.19\"]\n          url = git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.19.y.git\n          fetch = +refs/heads/*:refs/remotes/stable-2.6.19/*\n  [remote \"stable-2.6.20\"]\n          url = git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.20.y.git\n          fetch = +refs/heads/*:refs/remotes/stable-2.6.20/*\n  [remote \"wireless-2.6\"]\n          url = git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git\n          fetch = +refs/heads/*:refs/remotes/wireless-2.6/*\n  [briny(linux-2.6)] git-remote\n  origin\n  stable-2\n  wireless-2\n  wireless-dev\n\nWith this patch I get the correct list, but then it will break if\nthere are ever config keys like \"remote.$remote_name.foo.bar\".\n\n\n--- git-remote~\t2007-02-26 01:15:33.000000000 +1300\n+++ git-remote\t2007-02-26 20:31:20.000000000 +1300\n@@ -68,7 +68,7 @@\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*)\\s+(.*)$/) {\n \t\t\tadd_remote_config(\\%seen, $1, $2, $3);\n \t\t}\n \t}\n\n\n-- \nPaul Collins\nWellington, New Zealand\n\nDag vijandelijk luchtschip de huismeester is dood\n"},{"id":"35497","messageId":"erug4s$kn7$1@sea.gmane.org","threadId":"6968","inReplyTo":"87k5y5tlol.fsf@briny.internal.ondioline.org","subject":"Re: git-remote and remotes with '.' in their names","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-26T11:28:27Z","receivedAt":"2007-02-26T11:28:27Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Paul Collins wrote:\n\n> With this patch I get the correct list, but then it will break if\n> there are ever config keys like \"remote.$remote_name.foo.bar\".\n\nI don't think there would ever be key (variable) names with dots in them;\nif I remember correctly we don't allow this now.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"35498","messageId":"Pine.LNX.4.63.0702261227450.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6968","inReplyTo":"87k5y5tlol.fsf@briny.internal.ondioline.org","subject":"Re: git-remote and remotes with '.' in their names","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-26T11:28:50Z","receivedAt":"2007-02-26T11:28:50Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 26 Feb 2007, Paul Collins wrote:\n\n> With this patch I get the correct list, but then it will break if there \n> are ever config keys like \"remote.$remote_name.foo.bar\".\n\nI think you do not need to worry. AFAIR variable names in the config must \nnot contain dots, so the only way to set your example variable would be\n\n[remote \"$remote_name.foo\"]\n\tbar = blabla\n\nCiao,\nDscho\n"},{"id":"35810","messageId":"45E597CF.9000009@lu.unisi.ch","threadId":"6968","inReplyTo":"87k5y5tlol.fsf@briny.internal.ondioline.org","subject":"Re: git-remote and remotes with '.' in their names","fromName":"Paolo Bonzini","fromEmail":"paolo.bonzini@lu.unisi.ch","sentAt":"2007-02-28T14:55:11Z","receivedAt":"2007-02-28T14:55:11Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"Hello,\n\n>  \tfor (@remotes) {\n> -\t\tif (/^remote\\.([^.]*)\\.(\\S*)\\s+(.*)$/) {\n> +\t\tif (/^remote\\.(.*)\\.(\\S*)\\s+(.*)$/) {\n\nYou probably want either\n\n+\t\tif (/^remote\\.(\\S*)\\.(\\S*)\\s+(.*)$/) {\n\nor\n\n+\t\tif (/^remote\\.(\\S*)\\.([^.]*)\\s+(.*)$/) {\n\nhere.\n\nPaolo\n"},{"id":"35812","messageId":"Pine.LNX.4.63.0702281607220.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6968","inReplyTo":"45E597CF.9000009@lu.unisi.ch","subject":"Re: git-remote and remotes with '.' in their names","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-28T15:10:51Z","receivedAt":"2007-02-28T15:10:51Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 28 Feb 2007, Paolo Bonzini wrote:\n\n> Hello,\n> \n> >  \tfor (@remotes) {\n> > -\t\tif (/^remote\\.([^.]*)\\.(\\S*)\\s+(.*)$/) {\n> > +\t\tif (/^remote\\.(.*)\\.(\\S*)\\s+(.*)$/) {\n> \n> You probably want either\n> \n> +\t\tif (/^remote\\.(\\S*)\\.(\\S*)\\s+(.*)$/) {\n> \n> or\n> \n> +\t\tif (/^remote\\.(\\S*)\\.([^.]*)\\s+(.*)$/) {\n\nDid you mean to prevent the remote starting with a dot? IMHO that would be \na good change, but AFAIS both your proposals don't do that.\n\nCiao,\nDscho\n"},{"id":"35814","messageId":"45E59C47.9000001@lu.unisi.ch","threadId":"6968","inReplyTo":"Pine.LNX.4.63.0702281607220.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git-remote and remotes with '.' in their names","fromName":"Paolo Bonzini","fromEmail":"paolo.bonzini@lu.unisi.ch","sentAt":"2007-02-28T15:14:15Z","receivedAt":"2007-02-28T15:14:15Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 28 Feb 2007, Paolo Bonzini wrote:\n> \n>> Hello,\n>>\n>>>  \tfor (@remotes) {\n>>> -\t\tif (/^remote\\.([^.]*)\\.(\\S*)\\s+(.*)$/) {\n>>> +\t\tif (/^remote\\.(.*)\\.(\\S*)\\s+(.*)$/) {\n>> You probably want either\n>>\n>> +\t\tif (/^remote\\.(\\S*)\\.(\\S*)\\s+(.*)$/) {\n>>\n>> or\n>>\n>> +\t\tif (/^remote\\.(\\S*)\\.([^.]*)\\s+(.*)$/) {\n> \n> Did you mean to prevent the remote starting with a dot? IMHO that would be \n> a good change, but AFAIS both your proposals don't do that.\n\nNo, I meant to avoid the \".*\" in Paul's proposal.  They should be in \npractice equivalent but, with the second one, I made the regex more \nreadable: it is clearer that the $3 variable is not meant to include dots.\n\nYour proposal makes sense to me -- that would be\n\n+\t\tif (/^remote\\.([^.]\\S*)\\.([^.]*)\\s+(.*)$/) {\n\nPaolo\n"}]}