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

Re: [PATCH v4] git-contacts: allow inputting patch via stdin

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2026, 16:09 UTC
Message-ID
<xmqqy0cpwbw5.fsf@gitster.g>
In-Reply-To
<20260925-git-contacts-stdin-v4-1-9b4e4bcbb91c@brighamcampbell.com>
Brigham Campbell <me@brighamcampbell.com> writes:
Show 5 quoted lines
> Make git-contacts accept patch contents via stdin for better
> interoperability with other utilities. Read from stdin when the user
> passes `-` at least once:
>
> $ git contacts - <patch
OK.
> Even before this patch, git-contacts parses files first, then git
> rev-lists second, regardless of their order in argv. If we instead want
> git-contacts to parse arguments in the same order that they're passed,
> that's a change which should occur in a separate patch.
Fair enough.

We would want an update to contrib/contacts/git-contacts.adoc as well. Here is my attempt. I realize that the new text implies that we read only one patch from the standard input, but I do not know offhand whether scan_patches() successfully reads multiple patches concatenated together into a single stream. If it does, we may want to say "read patch file(s) from" instead.

The original uses <rev> in <angle brackets> to clarify that it is a placeholder, so the added text does the same for <patch>. The original text does not say what the command expects of the "patch files" it mentions, which may be worth improving and when it happens we would say <patch> in the description to refer to one argument on the command line. But I left it outside the scope of this message.

 contrib/contacts/git-contacts.adoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git c/contrib/contacts/git-contacts.adoc w/contrib/contacts/git-contacts.adoc
index dd914d1261..6473e878e0 100644
--- c/contrib/contacts/git-contacts.adoc
+++ w/contrib/contacts/git-contacts.adoc
@@ -24,7 +24,8 @@ Input consists of one or more patch files or revision arguments.  A revision
 argument can be a range or a single `<rev>` which is interpreted as
 `<rev>..HEAD`, thus the same revision arguments are accepted as for
 linkgit:git-format-patch[1]. Patch files and revision arguments can be combined
-in the same invocation.
+in the same invocation.  A single dash `'-'` character in place of a <patch>
+tells the command to read a patch from the standard input.  
 
 This command can be useful for determining the list of people with whom to
 discuss proposed changes, or for finding the list of recipients to Cc: when
Previous: Brigham CampbellNext: Brigham Campbell
Message 11 of 19 in “git-contacts: allow inputting patch via stdin”
  1. git-contacts: allow inputting patch via stdinBrigham Campbell, Sep 15, 2026
  2. Junio C HamanoSep 15, 2026
  3. git-contacts: allow inputting patch via stdinBrigham Campbell, Sep 16, 2026
  4. Junio C HamanoSep 16, 2026
  5. Brigham CampbellSep 17, 2026
  6. git-contacts: allow inputting patch via stdinBrigham Campbell, Sep 24, 2026
  7. Junio C HamanoSep 24, 2026
  8. Brigham CampbellSep 25, 2026
  9. Junio C HamanoSep 25, 2026
  10. git-contacts: allow inputting patch via stdinBrigham Campbell, Sep 25, 2026
  11. Junio C HamanoSep 25, 2026
  12. 0/2 git-contacts: allow inputting patch via stdinBrigham Campbell, Sep 29, 2026
  13. 1/2 git-contacts: allow inputting patch via stdinBrigham Campbell, Sep 29, 2026
  14. Junio C HamanoSep 29, 2026
  15. Brigham CampbellOct 2, 2026
  16. 2/2 git-contacts: add stdin functionality to docsBrigham Campbell, Sep 29, 2026
  17. Junio C HamanoSep 29, 2026
  18. git-contacts: allow inputting patch via stdinBrigham Campbell, Oct 2, 2026
  19. Junio C HamanoOct 2, 2026

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.