doc: correct misleading descriptions for --shallow-exclude

The documentation for the --shallow-exclude option to clone/fetch/etc. claims that the option takes a revision, but it does not. As per upload-pack.c's process_deepen_not(), it passes the option to expand_ref() and dies if it does not find exactly one ref matching the name passed. Further, this has always been the case ever since these options were introduced by the commits merged in a460ea4a3cb1 (Merge branch 'nd/shallow-deepen', 2016-10-10). Fix the documentation to match the implementation. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Nov 4, 2024 at 19:02 UTC 00e10e075100a1c84549c4463a05837f215d91c0
6 files changed +9 -9
Documentation/fetch-options.txt
+1 -1
@@ -29,7 +29,7 @@
29 Deepen or shorten the history of a shallow repository to
30 include all reachable commits after <date>.
31
32 ---shallow-exclude=<revision>::
32 +--shallow-exclude=<ref>::
33 Deepen or shorten the history of a shallow repository to
34 exclude commits reachable from a specified remote branch or tag.
35 This option can be specified multiple times.
Documentation/git-clone.txt
+1 -1
@@ -255,7 +255,7 @@ corresponding `--mirror` and `--no-tags` options instead.
255 `--shallow-since=<date>`::
256 Create a shallow clone with a history after the specified time.
257
258 -`--shallow-exclude=<revision>`::
258 +`--shallow-exclude=<ref>`::
259 Create a shallow clone with a history, excluding commits
260 reachable from a specified remote branch or tag. This option
261 can be specified multiple times.
Documentation/git-fetch-pack.txt
+1 -1
@@ -91,7 +91,7 @@ be in a separate packet, and the list must end with a flush packet.
91 Deepen or shorten the history of a shallow repository to
92 include all reachable commits after <date>.
93
94 ---shallow-exclude=<revision>::
94 +--shallow-exclude=<ref>::
95 Deepen or shorten the history of a shallow repository to
96 exclude commits reachable from a specified remote branch or tag.
97 This option can be specified multiple times.
builtin/clone.c
+2 -2
@@ -147,8 +147,8 @@ static struct option builtin_clone_options[] = {
147 N_("create a shallow clone of that depth")),
148 OPT_STRING(0, "shallow-since", &option_since, N_("time"),
149 N_("create a shallow clone since a specific time")),
150 - OPT_STRING_LIST(0, "shallow-exclude", &option_not, N_("revision"),
151 - N_("deepen history of shallow clone, excluding rev")),
150 + OPT_STRING_LIST(0, "shallow-exclude", &option_not, N_("ref"),
151 + N_("deepen history of shallow clone, excluding ref")),
152 OPT_BOOL(0, "single-branch", &option_single_branch,
153 N_("clone only one branch, HEAD or --branch")),
154 OPT_BOOL(0, "no-tags", &option_no_tags,
builtin/fetch.c
+2 -2
@@ -2216,8 +2216,8 @@ int cmd_fetch(int argc,
2216 N_("deepen history of shallow clone")),
2217 OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
2218 N_("deepen history of shallow repository based on time")),
2219 - OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
2220 - N_("deepen history of shallow clone, excluding rev")),
2219 + OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("ref"),
2220 + N_("deepen history of shallow clone, excluding ref")),
2221 OPT_INTEGER(0, "deepen", &deepen_relative,
2222 N_("deepen history of shallow clone")),
2223 OPT_SET_INT_F(0, "unshallow", &unshallow,
builtin/pull.c
+2 -2
@@ -218,8 +218,8 @@ static struct option pull_options[] = {
218 OPT_PASSTHRU_ARGV(0, "shallow-since", &opt_fetch, N_("time"),
219 N_("deepen history of shallow repository based on time"),
220 0),
221 - OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("revision"),
222 - N_("deepen history of shallow clone, excluding rev"),
221 + OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("ref"),
222 + N_("deepen history of shallow clone, excluding ref"),
223 0),
224 OPT_PASSTHRU_ARGV(0, "deepen", &opt_fetch, N_("n"),
225 N_("deepen history of shallow clone"),