{"thread":{"id":"11101","subject":"[PATCH] contrib: Make remotes2config.sh script more robust","startedAt":"2007-12-02T19:40:43Z","lastAt":"2007-12-02T19:40:43Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"61676","messageId":"1196624443-32382-1-git-send-email-jnareb@gmail.com","threadId":"11101","inReplyTo":null,"subject":"[PATCH] contrib: Make remotes2config.sh script more robust","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-02T19:40:43Z","receivedAt":"2007-12-02T19:40:43Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"The remotes2config.sh script replaced all 'unsafe' characters in repo\nname with '.'; include '-' in the 'safe' characters set (the set is\nprobably even larger).\n\nScript required also space after \"URL:\", \"Push:\" and \"Pull:\" in\nremotes file. This for example made the following remote\n  URL: git://git.kernel.org/pub/scm/git/git.git\n  Pull: refs/heads/master:refs/heads/origin\n  Pull:+refs/heads/pu:refs/heads/pu\nmiss 'pu' branch (forced branch) in config file after conversion.\nAllow for any number of whitespace after \"URL:\", \"Push:\", \"Pull:\".\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n contrib/remotes2config.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n mode change 100644 => 100755 contrib/remotes2config.sh\n\ndiff --git a/contrib/remotes2config.sh b/contrib/remotes2config.sh\nold mode 100644\nnew mode 100755\nindex 5838b3a..1cda19f\n--- a/contrib/remotes2config.sh\n+++ b/contrib/remotes2config.sh\n@@ -11,11 +11,11 @@ if [ -d \"$GIT_DIR\"/remotes ]; then\n \t{\n \t\tcd \"$GIT_DIR\"/remotes\n \t\tls | while read f; do\n-\t\t\tname=$(printf \"$f\" | tr -c \"A-Za-z0-9\" \".\")\n+\t\t\tname=$(printf \"$f\" | tr -c \"A-Za-z0-9-\" \".\")\n \t\t\tsed -n \\\n-\t\t\t-e \"s/^URL: \\(.*\\)$/remote.$name.url \\1 ./p\" \\\n-\t\t\t-e \"s/^Pull: \\(.*\\)$/remote.$name.fetch \\1 ^$ /p\" \\\n-\t\t\t-e \"s/^Push: \\(.*\\)$/remote.$name.push \\1 ^$ /p\" \\\n+\t\t\t-e \"s/^URL:[ \t]*\\(.*\\)$/remote.$name.url \\1 ./p\" \\\n+\t\t\t-e \"s/^Pull:[ \t]*\\(.*\\)$/remote.$name.fetch \\1 ^$ /p\" \\\n+\t\t\t-e \"s/^Push:[ \t]*\\(.*\\)$/remote.$name.push \\1 ^$ /p\" \\\n \t\t\t< \"$f\"\n \t\tdone\n \t\techo done\n-- \n1.5.3.6\n"}]}