line-log: mention both modes in 'blame' and 'log' short help
'git blame -h' and 'git log -h' both show '-L <n,m>' and describe this option as "Process only line range n,m, counting from 1". No hint is given that a function name regex can also be used. Use <range> instead, and expand the description of the option to mention both modes. Remove "counting from 1" as it's uneeded; it's uncommon to refer to the first line of a file as "line 0". Also, for 'git log', improve the wording to better reflect the long help. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philippe Blain committed
Nov 1, 2020 at 17:28 UTC
180d641d7d71ba45a140e9c83777d30be59c4274
2 files changed
+4
-3
builtin/blame.c
+2
-1
@@ -891,7 +891,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
891
OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use <file>'s contents as the final image")),
892
OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback),
893
OPT_CALLBACK_F('M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback),
894
- OPT_STRING_LIST('L', NULL, &range_list, N_("n,m"), N_("Process only line range n,m, counting from 1")),
894
+ OPT_STRING_LIST('L', NULL, &range_list, N_("range"),
895
+ N_("Process only line range <start>,<end> or function :<funcname>")),
896
OPT__ABBREV(&abbrev),
897
OPT_END()
898
};
builtin/log.c
+2
-2
@@ -183,8 +183,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
183
N_("pattern"), N_("do not decorate refs that match <pattern>")),
184
OPT_CALLBACK_F(0, "decorate", NULL, NULL, N_("decorate options"),
185
PARSE_OPT_OPTARG, decorate_callback),
186
- OPT_CALLBACK('L', NULL, &line_cb, "n,m:file",
187
- N_("Process line range n,m in file, counting from 1"),
186
+ OPT_CALLBACK('L', NULL, &line_cb, "range:file",
187
+ N_("Trace the evolution of line range <start>,<end> or function :<funcname> in <file>"),
188
log_line_range_callback),
189
OPT_END()
190
};