Thread (30 messages) 30 messages, 2 authors, 2021-09-21

Re: [PATCH v3 2/6] blame: replace usage end blurb with better option spec

From: Eric Sunshine <hidden>
Date: 2021-09-12 04:46:05

On Sat, Sep 11, 2021 at 3:10 PM Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
Change the "git blame -h" output to be consistent with "git bundle
-h"'s, i.e. before this we'd emit:
Just a couple tiny, tiny nits (which may or may not be worth a re-roll)...
    $ git blame -h
    usage: git blame [<options>] [<rev-opts>] [<rev>] [--] <file>

        <rev-opts> are documented in git-rev-list(1)
    [...]

Now instead of that we'll emit:

    $ git blame -h
    usage: git blame [<options>] [<git rev-list args>] [<rev>] [--] <file>
This is lacking a hyphen between `git` and `rev-list`...
This makes it consistent with the usage spec used for "git bundle":

    $ git bundle -h
    usage: git bundle create [<options>] <file> <git-rev-list args>
...whereas this has a hyphen between the two.
quoted hunk ↗ jump to hunk
[...]
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
diff --git a/builtin/blame.c b/builtin/blame.c
@@ -29,12 +29,8 @@
-       N_("<rev-opts> are documented in git-rev-list(1)"),
+       N_("git blame [<options>] [<git rev-list args>] [<rev>] [--] <file>"),
Ditto regarding missing hyphen.
quoted hunk ↗ jump to hunk
@@ -1107,7 +1103,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
                                    nth_line_cb, &sb, lno, anchor,
                                    &bottom, &top, sb.path,
                                    the_repository->index))
-                       usage(blame_usage);
+                       usage_msg_opt(_("Invalid -L <range> parameter"),
+                                     blame_opt_usage, options);
builltin/blame.c seems to be pretty consistent about starting error
and warning messages with a lowercase letter, so this perhaps should
follow suit. Also, I think you can drop "parameter" without losing
clarity:

    invalid -L range

would likely be good enough.
                if ((!lno && (top || bottom)) || lno < bottom)
                        die(Q_("file %s has only %lu line",
                               "file %s has only %lu lines",
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help