git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2025, 19:19 UTC
Message-ID
<xmqq34czhyz8.fsf@gitster.g>
In-Reply-To
<68e5eb78040419ba64e256910501c7e37194b222.1747763769.git.code@khaugsbakk.name>
kristofferhaugsbakk@fastmail.com writes:
Show 39 quoted lines
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>
> 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 <code@khaugsbakk.name>
> ---
>  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.
Previous: kristofferhaugsbakk@fastmail.comNext: Kristoffer Haugsbakk
Message 17 of 44 in “doc: --stdin on notes and core.commentChar mentions”
  1. 0/6 doc: --stdin on notes and core.commentChar mentionskristofferhaugsbakk@fastmail.com, May 20, 2025
  2. 1/6 doc: stripspace: mention where the default comes fromkristofferhaugsbakk@fastmail.com, May 20, 2025
  3. Junio C HamanoMay 20, 2025
  4. Kristoffer HaugsbakkMay 21, 2025
  5. 2/6 doc: config: mention core.commentChar on commit.cleanupkristofferhaugsbakk@fastmail.com, May 20, 2025
  6. 3/6 doc: notes: split out options with negationskristofferhaugsbakk@fastmail.com, May 20, 2025
  7. Junio C HamanoMay 20, 2025
  8. Junio C HamanoMay 21, 2025
  9. Kristoffer HaugsbakkMay 21, 2025
  10. Junio C HamanoMay 21, 2025
  11. Kristoffer HaugsbakkMay 21, 2025
  12. 4/6 doc: notes: mention comment character configurationkristofferhaugsbakk@fastmail.com, May 20, 2025
  13. Junio C HamanoMay 20, 2025
  14. 5/6 doc: notes: point out copy --stdin use with argvkristofferhaugsbakk@fastmail.com, May 20, 2025
  15. Junio C HamanoMay 20, 2025
  16. 6/6 doc: notes: treat --stdin equally between copy/removekristofferhaugsbakk@fastmail.com, May 20, 2025
  17. Junio C HamanoMay 20, 2025
  18. Kristoffer HaugsbakkMay 21, 2025
  19. D. Ben KnobleMay 21, 2025
  20. Kristoffer HaugsbakkMay 21, 2025
  21. Junio C HamanoMay 21, 2025
  22. 0/9 doc: --stdin on notes and core.commentChar mentionskristofferhaugsbakk@fastmail.com, May 23, 2025
  23. 1/9 doc: stripspace: mention where the default comes fromkristofferhaugsbakk@fastmail.com, May 23, 2025
  24. 2/9 doc: config: mention core.commentChar on commit.cleanupkristofferhaugsbakk@fastmail.com, May 23, 2025
  25. 3/9 doc: notes: split out options with negated formskristofferhaugsbakk@fastmail.com, May 23, 2025
  26. 4/9 doc: notes: rework --[no-]stripspacekristofferhaugsbakk@fastmail.com, May 23, 2025
  27. 5/9 doc: notes: remove stripspace discussion from other optionskristofferhaugsbakk@fastmail.com, May 23, 2025
  28. 6/9 doc: notes: clearly state that --stripspace is the defaultkristofferhaugsbakk@fastmail.com, May 23, 2025
  29. Junio C HamanoMay 23, 2025
  30. 7/9 doc: notes: point out copy --stdin use with argvkristofferhaugsbakk@fastmail.com, May 23, 2025
  31. 8/9 doc: notes: treat --stdin equally between copy/removekristofferhaugsbakk@fastmail.com, May 23, 2025
  32. Junio C HamanoMay 23, 2025
  33. 9/9 doc: notes: use stuck form throughoutkristofferhaugsbakk@fastmail.com, May 23, 2025
  34. 0/9 doc: --stdin on notes and core.commentChar mentionskristofferhaugsbakk@fastmail.com, May 27, 2025
  35. 1/9 doc: stripspace: mention where the default comes fromkristofferhaugsbakk@fastmail.com, May 27, 2025
  36. 2/9 doc: config: mention core.commentChar on commit.cleanupkristofferhaugsbakk@fastmail.com, May 27, 2025
  37. 3/9 doc: notes: split out options with negated formskristofferhaugsbakk@fastmail.com, May 27, 2025
  38. 4/9 doc: notes: rework --[no-]stripspacekristofferhaugsbakk@fastmail.com, May 27, 2025
  39. 5/9 doc: notes: remove stripspace discussion from other optionskristofferhaugsbakk@fastmail.com, May 27, 2025
  40. 6/9 doc: notes: clearly state that --stripspace is the defaultkristofferhaugsbakk@fastmail.com, May 27, 2025
  41. 7/9 doc: notes: point out copy --stdin use with argvkristofferhaugsbakk@fastmail.com, May 27, 2025
  42. 8/9 doc: notes: treat --stdin equally between copy/removekristofferhaugsbakk@fastmail.com, May 27, 2025
  43. 9/9 doc: notes: use stuck form throughoutkristofferhaugsbakk@fastmail.com, May 27, 2025
  44. Junio C HamanoMay 27, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.