threads / discuss / 25996

StandardInput Not Continuing Process

Subject: StandardInput Not Continuing Process

## tl;dr

5 messages between Dec 8, 2010 and Dec 25, 2010.

replies: 4people: 4as markdown or json

Chase Brammer· Dec 8, 2010, 17:25 UTC · lore

I am try to directly interact with Git by using only stdin, stdout, and stderr. So not going through a terminal at all, but calling Git directly.  I am having an issue with being able to continue a process that requires input.

For example, doing a clone from a HTTPS server may require a username/password. I writing the password as utf, and also tried just UTF byes (ie no prepended 16-bit int) but am unable to get the process to continue and start the clone process.

Is there some signal, or trick to getting the process to continue? I thought that sending a "\n" would work, but that doesn't seem to be working either.

Thanks for any help!
Chase
Chase Brammer· Dec 23, 2010, 16:55 UTC · re: Chase Brammer · lore

Re: StandardInput Not Continuing Process

Bump, any ideas?
Chase
On Wed, Dec 8, 2010 at 10:25 AM, Chase Brammer <cbrammer@gmail.com> wrote:
Show 19 quoted lines
>
> I am try to directly interact with Git by using only stdin, stdout,
> and stderr.  So
> not going through a terminal at all, but calling Git directly.   I am
> having an issue
> with being able to continue a process that requires input.
>
> For example, doing a clone from a HTTPS server may require a username/password.
> I writing the password as utf, and also tried just UTF byes (ie no
> prepended 16-bit int)
> but am unable to get the process to continue and start the clone process.
>
> Is there some signal, or trick to getting the process to continue?  I
> thought that sending a
> "\n" would work, but that doesn't seem to be working either.
>
> Thanks for any help!
>
> Chase
Brian Gernhardt· Dec 23, 2010, 17:18 UTC · re: Chase Brammer · lore

Re: StandardInput Not Continuing Process

OnOn Wed, Dec 8, 2010 at 10:25 AM, Chase Brammer <cbrammer@gmail.com> wrote:
Show 15 quoted lines
> 
> I am try to directly interact with Git by using only stdin, stdout,
> and stderr.  So
> not going through a terminal at all, but calling Git directly.   I am
> having an issue
> with being able to continue a process that requires input.
> 
> For example, doing a clone from a HTTPS server may require a username/password.
> I writing the password as utf, and also tried just UTF byes (ie no
> prepended 16-bit int)
> but am unable to get the process to continue and start the clone process.
> 
> Is there some signal, or trick to getting the process to continue?  I
> thought that sending a
> "\n" would work, but that doesn't seem to be working either.
Depending on what language you're using and your pipe settings, you might need to issue an fflush(git_stdin).
~~ Brian
Junio C Hamano· Dec 23, 2010, 17:20 UTC · re: Chase Brammer · lore

Re: StandardInput Not Continuing Process

Certain things do want a real user sitting at the terminal (or GUI) even when the standard streams are connected elsewhere, and password input is one of the obvious things that would explicitly want to read from the tty.

Perhaps driving whatever script you are writing via "expect" would work?
Tay Ray Chuan· Dec 25, 2010, 02:45 UTC · re: Chase Brammer · lore

Re: StandardInput Not Continuing Process

On Thu, Dec 9, 2010 at 1:25 AM, Chase Brammer <cbrammer@gmail.com> wrote:
> For example, doing a clone from a HTTPS server may require a username/password.
> I writing the password as utf, and also tried just UTF byes (ie no
> prepended 16-bit int)
> but am unable to get the process to continue and start the clone process.

Try putting the username and password in ~/.netrc, or in the url with https://user:pwd@foo.com/ - that way, you can skip the "input process" altogether.

-- 
Cheers,
Ray Chuan

← back to recent threads