Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] builtin/push.c: fix description of --recurse-submodules option

From: Jiang Xin <hidden>
Date: 2016-06-15 23:02:59

2014-11-19 1:57 GMT+08:00 Ralf Thielow [off-list ref]:
quoted hunk ↗ jump to hunk
The description of the option for argument "recurse-submodules"
is marked for translation even if it expects the untranslated
string and it's missing the option "on-demand" which was introduced
in eb21c73 (2014-03-29, push: teach --recurse-submodules the on-demand
option). Fix this by unmark the string for translation and add the
missing option.

Signed-off-by: Ralf Thielow <redacted>
---
 builtin/push.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/push.c b/builtin/push.c
index a076b19..cfa20c2 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -503,7 +503,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                  0, CAS_OPT_NAME, &cas, N_("refname>:<expect"),
                  N_("require old value of ref to be at this value"),
                  PARSE_OPT_OPTARG, parseopt_push_cas_option },
-               { OPTION_CALLBACK, 0, "recurse-submodules", &flags, N_("check"),
+               { OPTION_CALLBACK, 0, "recurse-submodules", &flags, "check|on-demand",
Yes, should not mark this for translation, and only two available options
for the "--recurse-submodules" flag.

The following code snippet is from builtin/push.c:

451 static int option_parse_recurse_submodules(const struct option *opt,
452                                    const char *arg, int unset)
453 {
454         int *flags = opt->value;
455
456         if (*flags & (TRANSPORT_RECURSE_SUBMODULES_CHECK |
457                       TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND))
458                 die("%s can only be used once.", opt->long_name);
459
460         if (arg) {
461                 if (!strcmp(arg, "check"))
462                         *flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK;
463                 else if (!strcmp(arg, "on-demand"))
464                         *flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND;
465                 else
466                         die("bad %s argument: %s", opt->long_name, arg);
467         } else
468                 die("option %s needs an argument (check|on-demand)",
469                                 opt->long_name);
470
471         return 0;
472 }


                        N_("control recursive pushing of submodules"),
                        PARSE_OPT_OPTARG, option_parse_recurse_submodules },
                OPT_BOOL( 0 , "thin", &thin, N_("use thin pack")),
--
2.2.0.rc2.258.gc851c5b


-- 
Jiang Xin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help