doc txt & -h consistency: word-wrap

Change the documentation and -h output for those built-in commands where both the -h output and *.txt were lacking in word-wrapping. There are many more built-ins that could use this treatment, this change is narrowed to those where this whitespace change is needed to make the -h and *.txt consistent in the end. In the case of "Documentation/git-hash-object.txt" and "builtin/hash-object.c" this is not a "doc txt & -h consistency" change, as we're changing both versions, doing so here makes a subsequent change smaller. 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 5af8b61cc36216bfde9d8b934fb8b657c2093aec
12 files changed +29 -16
Documentation/git-hash-object.txt
+2 -1
@@ -9,7 +9,8 @@ git-hash-object - Compute object ID and optionally creates a blob from a file
9 SYNOPSIS
10 --------
11 [verse]
12 -'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
12 +'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters]
13 + [--stdin [--literally]] [--] <file>...
14 'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
15
16 DESCRIPTION
Documentation/git-worktree.txt
+2 -1
@@ -9,7 +9,8 @@ git-worktree - Manage multiple working trees
9 SYNOPSIS
10 --------
11 [verse]
12 -'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]] [-b <new-branch>] <path> [<commit-ish>]
12 +'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]]
13 + [-b <new-branch>] <path> [<commit-ish>]
14 'git worktree list' [-v | --porcelain [-z]]
15 'git worktree lock' [--reason <string>] <worktree>
16 'git worktree move' <worktree> <new-path>
builtin/bugreport.c
+2 -1
@@ -60,7 +60,8 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)
60 }
61
62 static const char * const bugreport_usage[] = {
63 - N_("git bugreport [-o|--output-directory <file>] [-s|--suffix <format>] [--diagnose[=<mode>]"),
63 + N_("git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]\n"
64 + " [--diagnose[=<mode>]"),
65 NULL
66 };
67
builtin/commit-graph.c
+4 -4
@@ -13,10 +13,10 @@
13 N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]")
14
15 #define BUILTIN_COMMIT_GRAPH_WRITE_USAGE \
16 - N_("git commit-graph write [--object-dir <objdir>] [--append] " \
17 - "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] " \
18 - "[--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress] " \
19 - "<split options>")
16 + N_("git commit-graph write [--object-dir <objdir>] [--append]\n" \
17 + " [--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits]\n" \
18 + " [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]\n" \
19 + " <split options>")
20
21 static const char * builtin_commit_graph_verify_usage[] = {
22 BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
builtin/commit-tree.c
+2 -2
@@ -15,8 +15,8 @@
15 #include "parse-options.h"
16
17 static const char * const commit_tree_usage[] = {
18 - N_("git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] "
19 - "[(-F <file>)...] <tree>"),
18 + N_("git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
19 + " [(-F <file>)...] <tree>"),
20 NULL
21 };
22
builtin/diagnose.c
+2 -1
@@ -3,7 +3,8 @@
3 #include "diagnose.h"
4
5 static const char * const diagnose_usage[] = {
6 - N_("git diagnose [-o|--output-directory <path>] [-s|--suffix <format>] [--mode=<mode>]"),
6 + N_("git diagnose [-o|--output-directory <path>] [-s|--suffix <format>]\n"
7 + " [--mode=<mode>]"),
8 NULL
9 };
10
builtin/hash-object.c
+2 -1
@@ -80,7 +80,8 @@ static void hash_stdin_paths(const char *type, int no_filters, unsigned flags,
80 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] [--stdin] [--] <file>..."),
83 + N_("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
84 + " [--stdin] [--] <file>..."),
85 "git hash-object --stdin-paths",
86 NULL
87 };
builtin/init-db.c
+2 -1
@@ -515,7 +515,8 @@ static int shared_callback(const struct option *opt, const char *arg, int unset)
515 }
516
517 static const char *const init_db_usage[] = {
518 - N_("git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]"),
518 + N_("git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
519 + " [--shared[=<permissions>]] [<directory>]"),
520 NULL
521 };
522
builtin/interpret-trailers.c
+3 -1
@@ -13,7 +13,9 @@
13 #include "config.h"
14
15 static const char * const git_interpret_trailers_usage[] = {
16 - N_("git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])...] [<file>...]"),
16 + N_("git interpret-trailers [--in-place] [--trim-empty]\n"
17 + " [(--trailer <token>[(=|:)<value>])...]\n"
18 + " [<file>...]"),
19 NULL
20 };
21
builtin/read-tree.c
+3 -1
@@ -38,7 +38,9 @@ static int list_tree(struct object_id *oid)
38 }
39
40 static const char * const read_tree_usage[] = {
41 - N_("git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>) [-u | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"),
41 + N_("git read-tree [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>)\n"
42 + " [-u | -i]] [--no-sparse-checkout] [--index-output=<file>]\n"
43 + " (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"),
44 NULL
45 };
46
builtin/show-branch.c
+2 -1
@@ -14,7 +14,8 @@ static const char* show_branch_usage[] = {
14 N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
15 " [--current] [--color[=<when>] | --no-color] [--sparse]\n"
16 " [--more=<n> | --list | --independent | --merge-base]\n"
17 - " [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"),
17 + " [--no-name | --sha1-name] [--topics]\n"
18 + " [(<rev> | <glob>)...]"),
19 N_("git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"),
20 NULL
21 };
builtin/show-ref.c
+3 -1
@@ -9,7 +9,9 @@
9 #include "parse-options.h"
10
11 static const char * const show_ref_usage[] = {
12 - N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]"),
12 + N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference]\n"
13 + " [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
14 + " [--heads] [--] [<pattern>...]"),
15 N_("git show-ref --exclude-existing[=<pattern>]"),
16 NULL
17 };