diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-10-13 15:39:01 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-13 16:32:54 (GMT) |
commit | acf7828e388a67f6a7a025dc68b7012a6c3eee75 (patch) | |
tree | 4f923aada7526e6ca6e3133ecea3ee1690a059be /builtin/diff.c | |
parent | 6df5494f7347cf9a7b9ef2a74bb60cbedd62ae05 (diff) | |
download | git-acf7828e388a67f6a7a025dc68b7012a6c3eee75.zip git-acf7828e388a67f6a7a025dc68b7012a6c3eee75.tar.gz git-acf7828e388a67f6a7a025dc68b7012a6c3eee75.tar.bz2 |
built-ins: consistently add "\n" between "usage" and options
Change commands in the "diff" family and "rev-list" to separate the
usage information and option listing with an empty line.
In the case of "git diff -h" we did this already (but let's use a
consistent "\n" pattern there), for the rest these are now consistent
with how the parse_options() API would emit usage.
As we'll see in a subsequent commit this also helps to make the "git
<cmd> -h" output more easily machine-readable, as we can assume that
the usage information is separated from the options by an empty line.
Note that "COMMON_DIFF_OPTIONS_HELP" starts with a "\n", so the
seeming omission of a "\n" here is correct, the second one is provided
by the macro.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff.c')
-rw-r--r-- | builtin/diff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/diff.c b/builtin/diff.c index 54bb3de..67760b6 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -30,7 +30,8 @@ static const char builtin_diff_usage[] = " or: git diff [<options>] [--merge-base] <commit> [<commit>...] <commit> [--] [<path>...]\n" " or: git diff [<options>] <commit>...<commit> [--] [<path>...]\n" " or: git diff [<options>] <blob> <blob>\n" -" or: git diff [<options>] --no-index [--] <path> <path>\n" +" or: git diff [<options>] --no-index [--] <path> <path>" +"\n" COMMON_DIFF_OPTIONS_HELP; static const char *blob_path(struct object_array_entry *entry) |