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

Re: [PATCH 2/5] am: teach StGit patch parser how to read from stdin

From
Paul Tan <pyokagan@gmail.com>
Date
Jun 9, 2015, 09:38 UTC
Message-ID
<CACRoPnTAOsJE_VWJCadHh6Hpcw_c9DK7qARA5kC8_BBoXWHH6A@mail.gmail.com>
In-Reply-To
<xmqqh9qi9dmh.fsf@gitster.dls.corp.google.com>
On Tue, Jun 9, 2015 at 3:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
> Paul Tan <pyokagan@gmail.com> writes:
>
>> git-mailsplit, which splits mbox patches, will read the patch from stdin
>> when the filename is "-" or there are no files listed on the
>> command-line.
>>
>> To be consistent with this behavior, teach the StGit patch parser to
>> read from stdin if the filename is "-" or no files are listed on the
>> command-line.
>
> Hmm, doesn't
>
>         perl -ne 'processing for each line'
>
> with or without a BEGIN {} block, read from the standard input (if
> no filename is given) or the given file (if given), and more
> importantly, doesn't it treat a lone "-" as STDIN anyway?
>
> That is, wouldn't it make more sense to do something like:
>
>         test $# != 0 || set -- -
>         for stgit
>         do
>                 ...
>                 @@PERL@@ -ne 'BEGIN { $subject = 0 }
>                         ...
>                 ' "$stgit" >"$dotest/$msgnum" || clean_abort
>         done
>
> Same for patch 5/5.
Ah yes, this makes more sense.

Thanks, Paul

Previous: Junio C HamanoNext: Paul Tan
Message 5 of 9 in “am: improve test coverage and touch up foreign patch parsing”
  1. 0/5 am: improve test coverage and touch up foreign patch parsingPaul Tan, Jun 8, 2015
  2. 1/5 t4150: test applying StGit patchPaul Tan, Jun 8, 2015
  3. 2/5 am: teach StGit patch parser how to read from stdinPaul Tan, Jun 8, 2015
  4. Junio C HamanoJun 8, 2015
  5. Paul TanJun 9, 2015
  6. 3/5 t4150: test applying StGit seriesPaul Tan, Jun 8, 2015
  7. 4/5 am: use gmtime() to parse mercurial patch datePaul Tan, Jun 8, 2015
  8. 5/5 am: teach mercurial patch parser how to read from stdinPaul Tan, Jun 8, 2015
  9. Stefan BellerJun 8, 2015

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.