doc txt & -h consistency: add missing options

Change those built-in commands that were attempting to exhaustively list the options in the "-h" output to actually do so, and always have *.txt documentation know about the exhaustive list of options. Let's also fix the documentation and -h output for those built-in commands where the *.txt and -h output was a mismatch of missing options on both sides. In the case of "interpret-trailers" fixing the missing options reveals that the *.txt version was implicitly claiming that the command had two operating modes, which a look at the -h version (and studying the documentation) will show is not the case. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Oct 13, 2022 at 17:39 UTC d9054a19ed2656007a4ed198f1f07a00da9e7103
8 files changed +20 -8
Documentation/git-commit-graph.txt
+4 -1
@@ -10,7 +10,10 @@ SYNOPSIS
10 --------
11 [verse]
12 'git commit-graph verify' [--object-dir <dir>] [--shallow] [--[no-]progress]
13 -'git commit-graph write' <options> [--object-dir <dir>] [--[no-]progress]
13 +'git commit-graph write' [--object-dir <dir>] [--append]
14 + [--split[=<strategy>]] [--reachable | --stdin-packs | --stdin-commits]
15 + [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]
16 + <split options>
17
18
19 DESCRIPTION
Documentation/git-interpret-trailers.txt
+3 -2
@@ -8,8 +8,9 @@ git-interpret-trailers - Add or parse structured information in commit messages
8 SYNOPSIS
9 --------
10 [verse]
11 -'git interpret-trailers' [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]
12 -'git interpret-trailers' [<options>] [--parse] [<file>...]
11 +'git interpret-trailers' [--in-place] [--trim-empty]
12 + [(--trailer <token>[(=|:)<value>])...]
13 + [--parse] [<file>...]
14
15 DESCRIPTION
16 -----------
builtin/commit-tree.c
+1
@@ -15,6 +15,7 @@
15 #include "parse-options.h"
16
17 static const char * const commit_tree_usage[] = {
18 + N_("git commit-tree <tree> [(-p <parent>)...]"),
19 N_("git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
20 " [(-F <file>)...] <tree>"),
21 NULL
builtin/fsck.c
+4 -1
@@ -819,7 +819,10 @@ static int mark_packed_for_connectivity(const struct object_id *oid,
819 }
820
821 static char const * const fsck_usage[] = {
822 - N_("git fsck [<options>] [<object>...]"),
822 + N_("git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
823 + " [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
824 + " [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
825 + " [--[no-]name-objects] [<object>...]"),
826 NULL
827 };
828
builtin/hash-object.c
+2 -2
@@ -81,8 +81,8 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix)
81 {
82 static const char * const hash_object_usage[] = {
83 N_("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
84 - " [--stdin] [--] <file>..."),
85 - "git hash-object --stdin-paths",
84 + " [--stdin [--literally]] [--] <file>..."),
85 + N_("git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"),
86 NULL
87 };
88 const char *type = blob_type;
builtin/init-db.c
+2
@@ -516,6 +516,8 @@ static int shared_callback(const struct option *opt, const char *arg, int unset)
516
517 static const char *const init_db_usage[] = {
518 N_("git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
519 + " [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
520 + " [-b <branch-name> | --initial-branch=<branch-name>]\n"
521 " [--shared[=<permissions>]] [<directory>]"),
522 NULL
523 };
builtin/interpret-trailers.c
+1 -1
@@ -15,7 +15,7 @@
15 static const char * const git_interpret_trailers_usage[] = {
16 N_("git interpret-trailers [--in-place] [--trim-empty]\n"
17 " [(--trailer <token>[(=|:)<value>])...]\n"
18 - " [<file>...]"),
18 + " [--parse] [<file>...]"),
19 NULL
20 };
21
builtin/rm.c
+3 -1
@@ -17,7 +17,9 @@
17 #include "pathspec.h"
18
19 static const char * const builtin_rm_usage[] = {
20 - N_("git rm [<options>] [--] <file>..."),
20 + N_("git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
21 + " [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
22 + " [--] [<pathspec>...]"),
23 NULL
24 };
25