From: Junio C Hamano <gitster@pobox.com>
To: "Emily Shaffer via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Andrew Jeffrey <andrew@aj.id.au>,
Emily Shaffer <emilyshaffer@google.com>
Subject: Re: [PATCH v2] doc: document rev-list opts in revert, cherry-pick
Date: Wed, 27 Aug 2025 09:14:25 -0700 [thread overview]
Message-ID: <xmqqjz2o3foe.fsf@gitster.g> (raw)
In-Reply-To: <pull.2042.v2.git.git.1756279345929.gitgitgadget@gmail.com> (Emily Shaffer via GitGitGadget's message of "Wed, 27 Aug 2025 07:22:25 +0000")
"Emily Shaffer via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Emily Shaffer <emilyshaffer@google.com>
>
> In f873a273d1 (revert: accept arbitrary rev-list options, 2010-06-14),
> we added a handful of new options to `git revert` and `git cherry-pick`,
> but did not document them except by example to `cherry-pick` only. We
> have a nice shorthand for adding the rev-list documentation, so let's
> add it now, to both commands.
That's a blast from the past.
> diff --git a/Documentation/git-cherry-pick.adoc b/Documentation/git-cherry-pick.adoc
> index 42b41923d5f..03848aa9f21 100644
> --- a/Documentation/git-cherry-pick.adoc
> +++ b/Documentation/git-cherry-pick.adoc
> @@ -174,6 +174,8 @@ fail unless one of `--empty=keep` or `--allow-empty` are specified.
>
> include::rerere-options.adoc[]
>
> +include::rev-list-options.adoc[]
> +
Are there options that rev-list family of commands take that are
nonsense in the context of cherry-pick (and revert)?
The rev-list-options.adoc[] file is designed to be included from
different places, so for example it omits certain things from
appearing in the output. E.g., by doing things like:
`--ignore-missing`::
Upon seeing an invalid object name in the input, pretend as if
the bad input was not given.
ifndef::git-rev-list[]
`--bisect`::
Pretend as if the bad bisection ref `refs/bisect/bad`
was listed and as if it was followed by `--not` and the good
bisection refs `refs/bisect/good-*` on the command
line.
endif::git-rev-list[]
and not doing
:git-rev-list: 1
include::rev-list-options.adoc[]
we can exclude specific parts of the rev-list-options.adoc from
inclusion.
I know that the implementation took a blind^Wstupid route to allow
everything, but documenting them for unsuspecting general public
would make the harm larger. They wouldn't have even imagined to
type
git cherry-pick --graph master
if they weren't told that the command took such a nonsense option.
Have you reviewed what is in rev-list-options.adoc and thought about
excluding certain parts when the file is included in either
git-cherry-pick.adoc or git-revert.adoc?
prev parent reply other threads:[~2025-08-27 16:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 7:17 [PATCH] cherry-pick: document rev-list options Emily Shaffer via GitGitGadget
2025-08-27 7:22 ` [PATCH v2] doc: document rev-list opts in revert, cherry-pick Emily Shaffer via GitGitGadget
2025-08-27 7:36 ` Andrew Jeffery
2025-08-27 9:41 ` Phillip Wood
2025-08-27 11:34 ` Emily Shaffer
2025-08-27 16:14 ` Junio C Hamano [this message]
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=xmqqjz2o3foe.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=andrew@aj.id.au \
--cc=emilyshaffer@google.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@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).