{"thread":{"id":"16364","subject":"[PATCH 1/2] remote short help message updated","startedAt":"2008-11-17T09:12:29Z","lastAt":"2008-11-17T10:15:46Z","messageCount":4,"participants":["crquan@gmail.com","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"96013","messageId":"1226913150-26088-1-git-send-email-crquan@gmail.com","threadId":"16364","inReplyTo":null,"subject":"[PATCH 1/2] remote short help message updated","fromName":"","fromEmail":"crquan@gmail.com","sentAt":"2008-11-17T09:12:29Z","receivedAt":"2008-11-17T09:12:29Z","isPatch":true,"sender":{"key":"crquan@gmail.com","avatar":"https://gravatar.com/avatar/8689a8a26f5d1c7515ca8226258710684dac5c5208b84a9e16a086377f2d3ded?d=mp&s=160"},"body":"From: Cheng Renquan <crquan@gmail.com>\n\nSynced from git help remote.\n\nSigned-off-by: Cheng Renquan <crquan@gmail.com>\n---\n builtin-remote.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex 71696b5..d032f25 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -8,12 +8,12 @@\n #include \"refs.h\"\n \n static const char * const builtin_remote_usage[] = {\n-\t\"git remote\",\n-\t\"git remote add <name> <url>\",\n+\t\"git remote [-v | --verbose]\",\n+\t\"git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>\",\n \t\"git remote rename <old> <new>\",\n \t\"git remote rm <name>\",\n-\t\"git remote show <name>\",\n-\t\"git remote prune <name>\",\n+\t\"git remote show [-n] <name>\",\n+\t\"git remote prune [-n | --dry-run] <name>\",\n \t\"git remote update [group]\",\n \tNULL\n };\n-- \n1.6.0.2\n"},{"id":"96014","messageId":"1226913150-26088-2-git-send-email-crquan@gmail.com","threadId":"16364","inReplyTo":"1226913150-26088-1-git-send-email-crquan@gmail.com","subject":"[PATCH 2/2] git-remote: add verbose mode","fromName":"","fromEmail":"crquan@gmail.com","sentAt":"2008-11-17T09:12:30Z","receivedAt":"2008-11-17T09:12:30Z","isPatch":true,"sender":{"key":"crquan@gmail.com","avatar":"https://gravatar.com/avatar/8689a8a26f5d1c7515ca8226258710684dac5c5208b84a9e16a086377f2d3ded?d=mp&s=160"},"body":"From: Denis ChengRq <crquan@gmail.com>\n\nSigned-off-by: Cheng Renquan <crquan@gmail.com>\n---\n builtin-remote.c |   19 +++++++++++++------\n 1 files changed, 13 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin-remote.c b/builtin-remote.c\nindex d032f25..8a9f4b5 100644\n--- a/builtin-remote.c\n+++ b/builtin-remote.c\n@@ -14,7 +14,7 @@ static const char * const builtin_remote_usage[] = {\n \t\"git remote rm <name>\",\n \t\"git remote show [-n] <name>\",\n \t\"git remote prune [-n | --dry-run] <name>\",\n-\t\"git remote update [group]\",\n+\t\"git remote update [-v | --verbose] [group]\",\n \tNULL\n };\n \n@@ -40,10 +40,13 @@ static int opt_parse_track(const struct option *opt, const char *arg, int not)\n \treturn 0;\n }\n \n-static int fetch_remote(const char *name)\n+static int fetch_remote(const char *name, const char *url)\n {\n \tconst char *argv[] = { \"fetch\", name, NULL };\n-\tprintf(\"Updating %s\\n\", name);\n+\tif (verbose)\n+\t\tprintf(\"Updating %s (%s)\\n\", name, url);\n+\telse\n+\t\tprintf(\"Updating %s\\n\", name);\n \tif (run_command_v_opt(argv, RUN_GIT_CMD))\n \t\treturn error(\"Could not fetch %s\", name);\n \treturn 0;\n@@ -117,7 +120,7 @@ static int add(int argc, const char **argv)\n \t\t\treturn 1;\n \t}\n \n-\tif (fetch && fetch_remote(name))\n+\tif (fetch && fetch_remote(name, url))\n \t\treturn 1;\n \n \tif (master) {\n@@ -769,8 +772,12 @@ static int prune(int argc, const char **argv)\n static int get_one_remote_for_update(struct remote *remote, void *priv)\n {\n \tstruct string_list *list = priv;\n+\n \tif (!remote->skip_default_update)\n-\t\tstring_list_append(xstrdup(remote->name), list);\n+\t\tstring_list_append(remote->name, list)->util =\n+\t\t\tremote->url_nr > 0\n+\t\t\t? (void *)remote->url[remote->url_nr-1] : NULL;\n+\n \treturn 0;\n }\n \n@@ -818,7 +825,7 @@ static int update(int argc, const char **argv)\n \t\tresult = for_each_remote(get_one_remote_for_update, &list);\n \n \tfor (i = 0; i < list.nr; i++)\n-\t\tresult |= fetch_remote(list.items[i].string);\n+\t\tresult |= fetch_remote(list.items[i].string, list.items[i].util);\n \n \t/* all names were strdup()ed or strndup()ed */\n \tlist.strdup_strings = 1;\n-- \n1.6.0.2\n"},{"id":"96018","messageId":"7vmyfyzmio.fsf@gitster.siamese.dyndns.org","threadId":"16364","inReplyTo":"1226913150-26088-1-git-send-email-crquan@gmail.com","subject":"Re: [PATCH 1/2] remote short help message updated","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-17T10:15:27Z","receivedAt":"2008-11-17T10:15:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"crquan@gmail.com writes:\n\n> From: Cheng Renquan <crquan@gmail.com>\n>\n> Synced from git help remote.\n>\n> Signed-off-by: Cheng Renquan <crquan@gmail.com>\n\nWe strongly prefer writing commit log message in imperative mood, like:\n\n\t[PATCH] git-remote: match usage string with the manual pages\n\nThe patch itself looks good.  Thanks.\n"},{"id":"96019","messageId":"7vhc66zmi5.fsf@gitster.siamese.dyndns.org","threadId":"16364","inReplyTo":"1226913150-26088-2-git-send-email-crquan@gmail.com","subject":"Re: [PATCH 2/2] git-remote: add verbose mode","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-17T10:15:46Z","receivedAt":"2008-11-17T10:15:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"crquan@gmail.com writes:\n\n> From: Denis ChengRq <crquan@gmail.com>\n>\n> Signed-off-by: Cheng Renquan <crquan@gmail.com>\n\nYour other one (I am assuming the other one is also from you) has \"From:\nCheng Renquan <crquan@gmail.com>\" and this is \"From: Denis ChengRq\n<crquan@gmail.com>\".  We'd prefer to keep the same person under a single\nname in \"git shortlog\" list.  Under which name do you want to be known?\n\nPlease describe in what sense this is \"verbose\", iow, what additional\ninformation is added by this patch, in your proposed commit log message.\n\n> @@ -40,10 +40,13 @@ static int opt_parse_track(const struct option *opt, const char *arg, int not)\n>  \treturn 0;\n>  }\n>  \n> -static int fetch_remote(const char *name)\n> +static int fetch_remote(const char *name, const char *url)\n>  {\n>  \tconst char *argv[] = { \"fetch\", name, NULL };\n> -\tprintf(\"Updating %s\\n\", name);\n> +\tif (verbose)\n> +\t\tprintf(\"Updating %s (%s)\\n\", name, url);\n\nAre you guaranteeing that url is not NULL at this point in the code?\nIf so how?\n\nHow does this \"--verbose\" command the users give \"git remote\" relate to\nthe \"--verbose\" option the underlying \"git fetch\" has?  IOW, do you tell\n\"git fetch\" to be verbose as well?  If so, how?  If not, why not?\n"}]}