Thread (2 messages) 2 messages, 2 authors, 2025-05-21

Re: [PATCH 6/6] doc: notes: treat --stdin equally between copy/remove

From: Junio C Hamano <hidden>
Date: 2025-05-20 19:19:11

kristofferhaugsbakk@fastmail.com writes:
quoted hunk
From: Kristoffer Haugsbakk <redacted>

46538012d94 (notes remove: --stdin reads from the standard input,
2011-05-18) added `--stdin` for the `remove` subcommand, documenting it
in the “Options” section.  But `copy --stdin` was added before that, in
160baa0d9cb (notes: implement 'git notes copy --stdin', 2010-03-12).

Treat this option equally between the two subcommands:

• remove: mention `--stdin` on the subcommand as well, like for `copy`
• copy: mention it as well under the option documentation

Signed-off-by: Kristoffer Haugsbakk <redacted>
---
 Documentation/git-notes.adoc | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-notes.adoc b/Documentation/git-notes.adoc
index d2d7dac8d41..1542850eaaa 100644
--- a/Documentation/git-notes.adoc
+++ b/Documentation/git-notes.adoc
@@ -127,6 +127,10 @@ When done, the user can either finalize the merge with
 	giving zero or one object from the command line, this is
 	equivalent to specifying an empty note message to
 	the `edit` subcommand.
++
+In `--stdin` mode, also remove the object names given on standard
+input. In other words, `--stdin` can be combined with object names from
+the command line.
 
 `prune`::
 	Remove all notes for non-existing/unreachable objects.
@@ -208,9 +212,9 @@ See `core.commentChar` in linkgit:git-config[1].
 	object that does not have notes attached to it.
 
 `--stdin`::
-	Also read the object names to remove notes from the standard
-	input (there is no reason you cannot combine this with object
-	names from the command line).
The original was really bad, especially if it ignored the fact that
the 'copy' action also took the option.
+	For `remove` and `copy`. See the respective subcommands. This
+	option can be combined with object names given via the command
+	line for `remove`. However, this is not the case for `copy`.
During my first read of this paragraph, I somehow read the first two
sentences as "if you want to learn how this option behaves with the
remove and copy subcommands, go read the documentation for these
subcommands", making me anticipate that the remainder of the
paragraph would talks about what happens when --stdin is given to
other subcommands.  Apparently that is not what is going on.

It may be simpler to just say

	Only valid for `remove` and `copy`.  See the respective
	subcommands.

and stop there.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help