From: Pierre Ossman Date: Thu, 22 Sep 2005 11:08:21 GMT Subject: Re: StGIT cannot import properly from stdin Message-ID: <433290A5.5070008@drzeus.cx> In-Reply-To: Catalin Marinas wrote: > >It works for me with the latest snapshot. What might happen in your >case is a missing "---" line after the patch description. The import >command reads the sys.stdin file descriptor until the first "---" >line. After that, the git.apply() function will read the rest of the >lines and pass them to git-apply. You can put some prints in the >git.apply() function to check where it starts reading from. > > > Hmm... it seems you're kind of right. It doesn't need the patch twice. But it needs EOF more than once. The for-loop in __parse_patch() doesn't start until the EOF is recieved. And the second for-loop in _input() requires a new EOF. >Patches without description cannot be read from stdin at the moment. >Maybe I could add another option to prevent it from reading the >description. > > > If you would cache the input to a file (or memory) you would remove both of these problems. Rgds Pierre