From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>, Elijah Newren <newren@gmail.com>
Subject: [PATCH 2/2] doc: correct misleading descriptions for --shallow-exclude
Date: Mon, 04 Nov 2024 19:02:44 +0000 [thread overview]
Message-ID: <4c7f2dba686266be50cf11420beca633e1691dd4.1730746964.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1822.git.1730746964.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
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>
---
Documentation/fetch-options.txt | 2 +-
Documentation/git-clone.txt | 2 +-
Documentation/git-fetch-pack.txt | 2 +-
builtin/clone.c | 2 +-
builtin/fetch.c | 4 ++--
builtin/pull.c | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index 9dc7ac8dbdc..b01372e4b3c 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -29,7 +29,7 @@
Deepen or shorten the history of a shallow repository to
include all reachable commits after <date>.
---shallow-exclude=<revision>::
+--shallow-exclude=<ref>::
Deepen or shorten the history of a shallow repository to
exclude commits reachable from a specified remote branch or tag.
This option can be specified multiple times.
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 116ad648201..7acb4cb1761 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -255,7 +255,7 @@ corresponding `--mirror` and `--no-tags` options instead.
`--shallow-since=<date>`::
Create a shallow clone with a history after the specified time.
-`--shallow-exclude=<revision>`::
+`--shallow-exclude=<ref>`::
Create a shallow clone with a history, excluding commits
reachable from a specified remote branch or tag. This option
can be specified multiple times.
diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt
index b3467664d30..b5223576a75 100644
--- a/Documentation/git-fetch-pack.txt
+++ b/Documentation/git-fetch-pack.txt
@@ -91,7 +91,7 @@ be in a separate packet, and the list must end with a flush packet.
Deepen or shorten the history of a shallow repository to
include all reachable commits after <date>.
---shallow-exclude=<revision>::
+--shallow-exclude=<ref>::
Deepen or shorten the history of a shallow repository to
exclude commits reachable from a specified remote branch or tag.
This option can be specified multiple times.
diff --git a/builtin/clone.c b/builtin/clone.c
index 59fcb317a68..93fe6d69659 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -147,7 +147,7 @@ static struct option builtin_clone_options[] = {
N_("create a shallow clone of that depth")),
OPT_STRING(0, "shallow-since", &option_since, N_("time"),
N_("create a shallow clone since a specific time")),
- OPT_STRING_LIST(0, "shallow-exclude", &option_not, N_("revision"),
+ OPT_STRING_LIST(0, "shallow-exclude", &option_not, N_("ref"),
N_("deepen history of shallow clone, excluding rev")),
OPT_BOOL(0, "single-branch", &option_single_branch,
N_("clone only one branch, HEAD or --branch")),
diff --git a/builtin/fetch.c b/builtin/fetch.c
index d9027e4dc92..18eff4e5fa1 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2216,8 +2216,8 @@ int cmd_fetch(int argc,
N_("deepen history of shallow clone")),
OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
N_("deepen history of shallow repository based on time")),
- OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
- N_("deepen history of shallow clone, excluding rev")),
+ OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("ref"),
+ N_("deepen history of shallow clone, excluding ref")),
OPT_INTEGER(0, "deepen", &deepen_relative,
N_("deepen history of shallow clone")),
OPT_SET_INT_F(0, "unshallow", &unshallow,
diff --git a/builtin/pull.c b/builtin/pull.c
index 388ef3d1306..edc56907aa2 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -218,8 +218,8 @@ static struct option pull_options[] = {
OPT_PASSTHRU_ARGV(0, "shallow-since", &opt_fetch, N_("time"),
N_("deepen history of shallow repository based on time"),
0),
- OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("revision"),
- N_("deepen history of shallow clone, excluding rev"),
+ OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("ref"),
+ N_("deepen history of shallow clone, excluding ref"),
0),
OPT_PASSTHRU_ARGV(0, "deepen", &opt_fetch, N_("n"),
N_("deepen history of shallow clone"),
--
gitgitgadget
next prev parent reply other threads:[~2024-11-04 19:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 19:02 [PATCH 0/2] A few --shallow-exclude fixes Elijah Newren via GitGitGadget
2024-11-04 19:02 ` [PATCH 1/2] upload-pack: fix ambiguous error message Elijah Newren via GitGitGadget
2024-11-05 6:27 ` Patrick Steinhardt
2024-11-04 19:02 ` Elijah Newren via GitGitGadget [this message]
2024-11-05 6:27 ` [PATCH 2/2] doc: correct misleading descriptions for --shallow-exclude Patrick Steinhardt
2024-11-05 6:55 ` Junio C Hamano
2024-11-05 1:27 ` [PATCH 0/2] A few --shallow-exclude fixes Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4c7f2dba686266be50cf11420beca633e1691dd4.1730746964.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).