From: Catalin Marinas <catalin.marinas@gmail.com>
To: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: git@vger.kernel.org
Subject: Re: StGIT cannot import properly from stdin
Date: Thu, 22 Sep 2005 15:34:45 +0100 [thread overview]
Message-ID: <tnxr7bh188q.fsf@arm.com> (raw)
In-Reply-To: <4332BA3E.2080607@drzeus.cx> (Pierre Ossman's message of "Thu, 22 Sep 2005 16:05:50 +0200")
Pierre Ossman <drzeus-list@drzeus.cx> wrote:
>>Unfortunately, if the '---' line is missing, it consumes all the input
>>lines. Is this the case with your patch?
>
> Nope. It consumes the correct ammount of lines. The problem is that I
> have to give it a kick (^D) to start things twice. The first for
> __parse_patch() and the second for _input(). I put some debug-prints in
> there and the for-loops will not start executing on the first complete
> line, only EOF.
I tried it with reading from the terminal directly and you are right.
Using 'stg import -n patch < patch-file' is fine since the stdin is
not re-opened and the _input() loop starts automatically.
'cat | stg import -n patch' also works fine since cat exits when stdin
receives EOF.
It looks like a problem with Python since it re-opens sys.stdin once
it receives EOF.
>>>If you would cache the input to a file (or memory) you would remove both
>>>of these problems.
>>
>>True, but it requires more work than simply writing the patch to a
>>file and reading it twice.
>
> If it supports everything when given a filename then shouldn't adding a
> preprocessing step to dump stdin to disk give the same code path?
I was referring to the 'cache the input to memory' variant, which is a
bit more complicated. Caching to a file is simple but do you need to
read patches from the terminal directly?
--
Catalin
next prev parent reply other threads:[~2005-09-22 14:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-21 7:12 StGIT cannot import properly from stdin Pierre Ossman
2005-09-21 8:03 ` Catalin Marinas
2005-09-22 11:08 ` Pierre Ossman
2005-09-22 12:11 ` Catalin Marinas
2005-09-22 14:05 ` Pierre Ossman
2005-09-22 14:34 ` Catalin Marinas [this message]
2005-09-22 15:06 ` Pierre Ossman
2005-09-22 15:42 ` Catalin Marinas
2005-09-22 15:48 ` Catalin Marinas
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=tnxr7bh188q.fsf@arm.com \
--to=catalin.marinas@gmail.com \
--cc=drzeus-list@drzeus.cx \
--cc=git@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).