{"thread":{"id":"4038","subject":"[PATCH] Add a conversion tool to migrate remote information into the config","startedAt":"2006-05-03T13:27:26Z","lastAt":"2006-05-03T13:27:26Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19428","messageId":"Pine.LNX.4.63.0605031526280.6975@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4038","inReplyTo":null,"subject":"[PATCH] Add a conversion tool to migrate remote information into the config","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-03T13:27:26Z","receivedAt":"2006-05-03T13:27:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nUse this tool to rewrite the .git/remotes/* files into the config.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n contrib/remotes2config.sh |   35 +++++++++++++++++++++++++++++++++++\n 1 files changed, 35 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/remotes2config.sh b/contrib/remotes2config.sh\nnew file mode 100644\nindex 0000000..25901e2\n--- /dev/null\n+++ b/contrib/remotes2config.sh\n@@ -0,0 +1,35 @@\n+#!/bin/sh\n+\n+# Use this tool to rewrite your .git/remotes/ files into the config.\n+\n+. git-sh-setup\n+\n+if [ -d \"$GIT_DIR\"/remotes ]; then\n+\techo \"Rewriting $GIT_DIR/remotes\" >&2\n+\terror=0\n+\t# rewrite into config\n+\t{\n+\t\tcd \"$GIT_DIR\"/remotes\n+\t\tls | while read f; do\n+\t\t\tname=$(echo -n \"$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< \"$f\"\n+\t\tdone\n+\t\techo done\n+\t} | while read key value regex; do\n+\t\tcase $key in\n+\t\tdone)\n+\t\t\tif [ $error = 0 ]; then\n+\t\t\t\tmv \"$GIT_DIR\"/remotes \"$GIT_DIR\"/remotes.old\n+\t\t\tfi ;;\n+\t\t*)\n+\t\t\techo \"git-repo-config $key \"$value\" $regex\"\n+\t\t\tgit-repo-config $key \"$value\" $regex || error=1 ;;\n+\t\tesac\n+\tdone\n+fi\n+\n+\n"}]}