All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Brigham Campbell <me@brighamcampbell.com>
Cc: git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH v3] git-contacts: allow inputting patch via stdin
Date: Wed, 23 Sep 2026 21:13:57 -0700	[thread overview]
Message-ID: <xmqqtsnf477e.fsf@gitster.g> (raw)
In-Reply-To: <20260923-git-contacts-stdin-v3-1-56dd43c64d56@brighamcampbell.com> (Brigham Campbell's message of "Wed, 23 Sep 2026 19:25:30 -0600")

Brigham Campbell <me@brighamcampbell.com> writes:

> $ git contacts - <patch
> $ git contacts patch1 - patch3 <patch2

The second one is an example that we could tell the command to read
these three files in patch1 and then patch2 and then patch3.

> -my (@files, @rev_args);
> +my (@files, @rev_args, $read_from_stdin);
>  for (@ARGV) {
> -	if (-e) {
> +	if ($_ eq '-') {
> +		$read_from_stdin = 1;
> +	} elsif (-e) {
>  		push @files, $_;
>  	} else {
>  		push @rev_args, $_;

But this does not match what I would expect here, which would be
to have something like this ...

        if (-e || $_ eq '-') {
	        push @files, $_;
        } else {
		push @rev_args, $_;
	}

... around here, and then tell scan_patch_file that "-" shouldn't be
opened and instead read from the standard input stream, perhaps like

        sub scan_patch_file {
                my ($commits, $file) = @_;
                if ($file eq '-') {
                        $f = \*STDIN;
                } else {
                        open my $f, '<', $file or die "read failure: $file: $!\n";
                }
                scan_patches($commits, undef, $f);
                close $f;
        }

or something.

  reply	other threads:[~2026-09-24  4:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  2:43 [PATCH] git-contacts: allow inputting patch via stdin Brigham Campbell
2026-09-15  4:29 ` Junio C Hamano
2026-09-16  4:52 ` [PATCH v2] " Brigham Campbell
2026-09-16 14:25   ` Junio C Hamano
2026-09-17  6:56     ` Brigham Campbell
2026-09-24  1:25 ` [PATCH v3] " Brigham Campbell
2026-09-24  4:13   ` Junio C Hamano [this message]
2026-09-25  1:51     ` Brigham Campbell
2026-09-25  4:38       ` Junio C Hamano
2026-09-25  6:42 ` [PATCH v4] " Brigham Campbell
2026-09-25 16:09   ` Junio C Hamano
2026-09-29  5:47 ` [PATCH v5 0/2] " Brigham Campbell
2026-09-29  5:47   ` [PATCH v5 1/2] " Brigham Campbell
2026-09-29 19:29     ` Junio C Hamano
2026-10-02  4:44       ` Brigham Campbell
2026-09-29  5:47   ` [PATCH v5 2/2] git-contacts: add stdin functionality to docs Brigham Campbell
2026-09-29 16:30   ` [PATCH v5 0/2] git-contacts: allow inputting patch via stdin Junio C Hamano
2026-10-02  6:50 ` [PATCH v6] " Brigham Campbell
2026-10-02 14:50   ` Junio C Hamano

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=xmqqtsnf477e.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.