{"thread":{"id":"19717","subject":"[PATCH] builtin-remote: Make \"remote show\" display all urls","startedAt":"2009-06-06T15:16:30Z","lastAt":"2009-06-06T15:16:30Z","messageCount":1,"participants":["Michael J Gruber"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"115656","messageId":"1244301390-27295-1-git-send-email-git@drmicha.warpmail.net","threadId":"19717","inReplyTo":null,"subject":"[PATCH] builtin-remote: Make \"remote show\" display all urls","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-06-06T15:16:30Z","receivedAt":"2009-06-06T15:16:30Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Currently, \"git remote -v\" lists all urls whereas \"git remote show\n$remote\" shows only the first. Make it so that both show all.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nWhile looking around what I need to change in builtin-remote.c for the pushurls\nI noticed the above asymmetric behaviour. While I'm not sure what multiple urls\nare good for (as far as fetches are concerned) I think we should still show them\n(they may all be used for push).\n\nThis is on top of maint.\n\n builtin-remote.c |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex fda9a54..d436412 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -1003,9 +1003,12 @@ static int show(int argc, const char **argv)\n \n \t\tget_remote_ref_states(*argv, &states, query_flag);\n \n-\t\tprintf(\"* remote %s\\n  URL: %s\\n\", *argv,\n-\t\t\tstates.remote->url_nr > 0 ?\n-\t\t\t\tstates.remote->url[0] : \"(no URL)\");\n+\t\tprintf(\"* remote %s\\n\", *argv);\n+\t\tif (states.remote->url_nr) {\n+\t\t\tfor (i=0; i < states.remote->url_nr; i++)\n+\t\t\t\tprintf(\"  URL: %s\\n\", states.remote->url[i]);\n+\t\t} else\n+\t\t\tprintf(\"  URL: %s\\n\", \"(no URL)\");\n \t\tif (no_query)\n \t\t\tprintf(\"  HEAD branch: (not queried)\\n\");\n \t\telse if (!states.heads.nr)\n-- \n1.6.3.2.277.gd10543\n"}]}