Skip to content

Commit 180d641

Browse files
phil-blaingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0cce88f commit 180d641

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

builtin/blame.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
891891
OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use <file>'s contents as the final image")),
892892
OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback),
893893
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>")),
895896
OPT__ABBREV(&abbrev),
896897
OPT_END()
897898
};

builtin/log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
183183
N_("pattern"), N_("do not decorate refs that match <pattern>")),
184184
OPT_CALLBACK_F(0, "decorate", NULL, NULL, N_("decorate options"),
185185
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>"),
188188
log_line_range_callback),
189189
OPT_END()
190190
};

0 commit comments

Comments
 (0)