{"thread":{"id":"37999","subject":"[PATCH] builtin/push.c: fix description of --recurse-submodules option","startedAt":"2014-11-18T17:57:46Z","lastAt":"2014-11-19T00:46:32Z","messageCount":2,"participants":["Ralf Thielow","Jiang Xin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"252094","messageId":"1416333466-27186-1-git-send-email-ralf.thielow@gmail.com","threadId":"37999","inReplyTo":null,"subject":"[PATCH] builtin/push.c: fix description of --recurse-submodules option","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2014-11-18T17:57:46Z","receivedAt":"2014-11-18T17:57:46Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"The description of the option for argument \"recurse-submodules\"\nis marked for translation even if it expects the untranslated\nstring and it's missing the option \"on-demand\" which was introduced\nin eb21c73 (2014-03-29, push: teach --recurse-submodules the on-demand\noption). Fix this by unmark the string for translation and add the\nmissing option.\n\nSigned-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\n builtin/push.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/push.c b/builtin/push.c\nindex a076b19..cfa20c2 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -503,7 +503,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \t\t  0, CAS_OPT_NAME, &cas, N_(\"refname>:<expect\"),\n \t\t  N_(\"require old value of ref to be at this value\"),\n \t\t  PARSE_OPT_OPTARG, parseopt_push_cas_option },\n-\t\t{ OPTION_CALLBACK, 0, \"recurse-submodules\", &flags, N_(\"check\"),\n+\t\t{ OPTION_CALLBACK, 0, \"recurse-submodules\", &flags, \"check|on-demand\",\n \t\t\tN_(\"control recursive pushing of submodules\"),\n \t\t\tPARSE_OPT_OPTARG, option_parse_recurse_submodules },\n \t\tOPT_BOOL( 0 , \"thin\", &thin, N_(\"use thin pack\")),\n-- \n2.2.0.rc2.258.gc851c5b\n"},{"id":"252151","messageId":"CANYiYbG-r2tHXQureuqoFZ+7t27u78w-QUooHAXHRX5qNU+zOg@mail.gmail.com","threadId":"37999","inReplyTo":"1416333466-27186-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCH] builtin/push.c: fix description of --recurse-submodules option","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2014-11-19T00:46:32Z","receivedAt":"2014-11-19T00:46:32Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2014-11-19 1:57 GMT+08:00 Ralf Thielow <ralf.thielow@gmail.com>:\n> The description of the option for argument \"recurse-submodules\"\n> is marked for translation even if it expects the untranslated\n> string and it's missing the option \"on-demand\" which was introduced\n> in eb21c73 (2014-03-29, push: teach --recurse-submodules the on-demand\n> option). Fix this by unmark the string for translation and add the\n> missing option.\n>\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n>  builtin/push.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/builtin/push.c b/builtin/push.c\n> index a076b19..cfa20c2 100644\n> --- a/builtin/push.c\n> +++ b/builtin/push.c\n> @@ -503,7 +503,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n>                   0, CAS_OPT_NAME, &cas, N_(\"refname>:<expect\"),\n>                   N_(\"require old value of ref to be at this value\"),\n>                   PARSE_OPT_OPTARG, parseopt_push_cas_option },\n> -               { OPTION_CALLBACK, 0, \"recurse-submodules\", &flags, N_(\"check\"),\n> +               { OPTION_CALLBACK, 0, \"recurse-submodules\", &flags, \"check|on-demand\",\n\nYes, should not mark this for translation, and only two available options\nfor the \"--recurse-submodules\" flag.\n\nThe following code snippet is from builtin/push.c:\n\n451 static int option_parse_recurse_submodules(const struct option *opt,\n452                                    const char *arg, int unset)\n453 {\n454         int *flags = opt->value;\n455\n456         if (*flags & (TRANSPORT_RECURSE_SUBMODULES_CHECK |\n457                       TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND))\n458                 die(\"%s can only be used once.\", opt->long_name);\n459\n460         if (arg) {\n461                 if (!strcmp(arg, \"check\"))\n462                         *flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK;\n463                 else if (!strcmp(arg, \"on-demand\"))\n464                         *flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND;\n465                 else\n466                         die(\"bad %s argument: %s\", opt->long_name, arg);\n467         } else\n468                 die(\"option %s needs an argument (check|on-demand)\",\n469                                 opt->long_name);\n470\n471         return 0;\n472 }\n\n\n\n>                         N_(\"control recursive pushing of submodules\"),\n>                         PARSE_OPT_OPTARG, option_parse_recurse_submodules },\n>                 OPT_BOOL( 0 , \"thin\", &thin, N_(\"use thin pack\")),\n> --\n> 2.2.0.rc2.258.gc851c5b\n>\n\n\n\n-- \nJiang Xin\n"}]}