From: Junio C Hamano Date: Tue, 29 Sep 2026 19:29:31 GMT Subject: Re: [PATCH v5 1/2] git-contacts: allow inputting patch via stdin Message-ID: In-Reply-To: <20260928-git-contacts-stdin-v5-1-e9becaebc47e@brighamcampbell.com> Brigham Campbell writes: > 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 - > Signed-off-by: Brigham Campbell > --- > contrib/contacts/git-contacts | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/contrib/contacts/git-contacts b/contrib/contacts/git-contacts > index 85ad732fc0..df7b920d9e 100755 > --- a/contrib/contacts/git-contacts > +++ b/contrib/contacts/git-contacts > @@ -162,9 +162,11 @@ if (!@ARGV) { > die "No input revisions or patch files\n"; > } > > -my (@files, @rev_args); > +my ($read_from_stdin, @files, @rev_args); > for (@ARGV) { > - if (-e) { > + if ($_ eq '-') { > + $read_from_stdin = 1; > + } elsif (-e) { > push @files, $_; > } else { > push @rev_args, $_; > @@ -172,6 +174,9 @@ for (@ARGV) { > } > > my %sources; > +if ($read_from_stdin) { > + scan_patches(\%sources, undef, \*STDIN); > +} > for (@files) { > scan_patch_file(\%sources, $_); > } Doesn't the Usage comment at the beginning also want to be updated? Thanks. diff --git i/contrib/contacts/git-contacts w/contrib/contacts/git-contacts index 85ad732fc0..1eb91c4ab1 100755 --- i/contrib/contacts/git-contacts +++ w/contrib/contacts/git-contacts @@ -3,7 +3,7 @@ # List people who might be interested in a patch. Useful as the argument to # git-send-email --cc-cmd option, and in other situations. # -# Usage: git contacts ... +# Usage: git contacts ... use strict; use warnings;