From 180d641d7d71ba45a140e9c83777d30be59c4274 Mon Sep 17 00:00:00 2001 From: Philippe Blain Date: Sun, 1 Nov 2020 17:28:44 +0000 Subject: [PATCH] line-log: mention both modes in 'blame' and 'log' short help 'git blame -h' and 'git log -h' both show '-L ' 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 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 Signed-off-by: Junio C Hamano --- builtin/blame.c | 3 ++- builtin/log.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index b5036ab327..484e194068 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -891,7 +891,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix) OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use 's contents as the final image")), OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback), OPT_CALLBACK_F('M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback), - OPT_STRING_LIST('L', NULL, &range_list, N_("n,m"), N_("Process only line range n,m, counting from 1")), + OPT_STRING_LIST('L', NULL, &range_list, N_("range"), + N_("Process only line range , or function :")), OPT__ABBREV(&abbrev), OPT_END() }; diff --git a/builtin/log.c b/builtin/log.c index 0a7ed4bef9..c87ce09325 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -183,8 +183,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, N_("pattern"), N_("do not decorate refs that match ")), OPT_CALLBACK_F(0, "decorate", NULL, NULL, N_("decorate options"), PARSE_OPT_OPTARG, decorate_callback), - OPT_CALLBACK('L', NULL, &line_cb, "n,m:file", - N_("Process line range n,m in file, counting from 1"), + OPT_CALLBACK('L', NULL, &line_cb, "range:file", + N_("Trace the evolution of line range , or function : in "), log_line_range_callback), OPT_END() }; -- 2.32.0.93.g670b81a890