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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 24, 2026, 04:13 UTC
Message-ID
<xmqqtsnf477e.fsf@gitster.g>
In-Reply-To
<20260923-git-contacts-stdin-v3-1-56dd43c64d56@brighamcampbell.com>
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.

Show 10 quoted lines
> -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.
Previous: Brigham CampbellNext: Brigham Campbell
Message 7 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.