All of lore.kernel.org
 help / color / mirror / Atom feed
* disable interactive prompting
@ 2017-10-04 16:10 Ernesto Alfonso
  2017-10-04 17:01 ` Jonathan Nieder
  2017-10-04 17:05 ` Jeff King
  0 siblings, 2 replies; 5+ messages in thread
From: Ernesto Alfonso @ 2017-10-04 16:10 UTC (permalink / raw)
  To: git

Hi,

Waiting for git-push synchronously slows me down, so I have a bash
alias/function to do this in the background. But when my origin is https, I
get an undesired interactive prompt. I've tried to disable by
redirecting stdin:

git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null

but I still get an interactive prompt.

Is there a way to either

1. disable interactive prompting
2. programmatically determine whether a git command (or at least a git
push) would interactively prompt

Thanks,

Ernesto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: disable interactive prompting
  2017-10-04 16:10 disable interactive prompting Ernesto Alfonso
@ 2017-10-04 17:01 ` Jonathan Nieder
  2017-10-04 17:09   ` Ernesto Alfonso
  2017-10-04 17:05 ` Jeff King
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Nieder @ 2017-10-04 17:01 UTC (permalink / raw)
  To: Ernesto Alfonso; +Cc: git, Jeff King

Hi Ernesto,

Ernesto Alfonso wrote:

> Waiting for git-push synchronously slows me down, so I have a bash
> alias/function to do this in the background. But when my origin is https, I
> get an undesired interactive prompt. I've tried to disable by
> redirecting stdin:
>
> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null
>
> but I still get an interactive prompt.
>
> Is there a way to either
>
> 1. disable interactive prompting
> 2. programmatically determine whether a git command (or at least a git
> push) would interactively prompt

You left out an important detail: what does the interactive prompt in
question say?

The general question is also interesting, but seeing the particular
prompt would make it easy to look into the specific case at the same
time.

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: disable interactive prompting
  2017-10-04 16:10 disable interactive prompting Ernesto Alfonso
  2017-10-04 17:01 ` Jonathan Nieder
@ 2017-10-04 17:05 ` Jeff King
  2017-10-04 17:46   ` Ernesto Alfonso
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff King @ 2017-10-04 17:05 UTC (permalink / raw)
  To: Ernesto Alfonso; +Cc: git

On Wed, Oct 04, 2017 at 09:10:48AM -0700, Ernesto Alfonso wrote:

> Waiting for git-push synchronously slows me down, so I have a bash
> alias/function to do this in the background. But when my origin is https, I
> get an undesired interactive prompt. I've tried to disable by
> redirecting stdin:
> 
> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null
> 
> but I still get an interactive prompt.
> 
> Is there a way to either
> 
> 1. disable interactive prompting
> 2. programmatically determine whether a git command (or at least a git
> push) would interactively prompt

I assume the prompt is for credentials, since that's generally the only
thing git-push will prompt for.

Try:

  $ git help git | sed -ne '/PROMPT/,/^$/p'
         GIT_TERMINAL_PROMPT
           If this environment variable is set to 0, git will not prompt on
           the terminal (e.g., when asking for HTTP authentication).

Of course that just stops the prompting. If Git needs a credential and
you don't provide it, then the push will fail.

For advice on that that, try "git help credentials".

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: disable interactive prompting
  2017-10-04 17:01 ` Jonathan Nieder
@ 2017-10-04 17:09   ` Ernesto Alfonso
  0 siblings, 0 replies; 5+ messages in thread
From: Ernesto Alfonso @ 2017-10-04 17:09 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Jeff King

Hi,

The prompt asks for my https username/password:


> $ grv
> origin	https://github.com/user/dotemacs (fetch)
> origin	https://github.com/user/dotemacs (push)
> $ gpom
> [1] 22549
> $ Username for 'https://github.com': 
> $ fg
> { git push origin master &>/dev/null < /dev/null; LAST=$?; test 0 -eq $LAST || echo "gpom failed with $LAST !"; }
> Password for 'https://asd,csd@github.com': 
> gpom failed with 128 !
> $ 


Thanks,

Ernesto

Jonathan Nieder <jrnieder@gmail.com> writes:

> Hi Ernesto,
>
> Ernesto Alfonso wrote:
>
>> Waiting for git-push synchronously slows me down, so I have a bash
>> alias/function to do this in the background. But when my origin is https, I
>> get an undesired interactive prompt. I've tried to disable by
>> redirecting stdin:
>>
>> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null
>>
>> but I still get an interactive prompt.
>>
>> Is there a way to either
>>
>> 1. disable interactive prompting
>> 2. programmatically determine whether a git command (or at least a git
>> push) would interactively prompt
>
> You left out an important detail: what does the interactive prompt in
> question say?
>
> The general question is also interesting, but seeing the particular
> prompt would make it easy to look into the specific case at the same
> time.
>
> Thanks,
> Jonathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: disable interactive prompting
  2017-10-04 17:05 ` Jeff King
@ 2017-10-04 17:46   ` Ernesto Alfonso
  0 siblings, 0 replies; 5+ messages in thread
From: Ernesto Alfonso @ 2017-10-04 17:46 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Thanks for pointing out the option. 

I tried "git help push" and searched for "prompt", "interactive",
"credentials"...

I don't think I would have figured to try
 "git help git" from "git help" even after reading it carefully.

I'd suggest adding a hint in "git help".

I also don't seem have the GIT_TERMINAL_PROMPT in "git version 1.8.3.1" but I can fix this.

Thanks,

Ernesto
Jeff King <peff@peff.net> writes:

> On Wed, Oct 04, 2017 at 09:10:48AM -0700, Ernesto Alfonso wrote:
>
>> Waiting for git-push synchronously slows me down, so I have a bash
>> alias/function to do this in the background. But when my origin is https, I
>> get an undesired interactive prompt. I've tried to disable by
>> redirecting stdin:
>> 
>> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null
>> 
>> but I still get an interactive prompt.
>> 
>> Is there a way to either
>> 
>> 1. disable interactive prompting
>> 2. programmatically determine whether a git command (or at least a git
>> push) would interactively prompt
>
> I assume the prompt is for credentials, since that's generally the only
> thing git-push will prompt for.
>
> Try:
>
>   $ git help git | sed -ne '/PROMPT/,/^$/p'
>          GIT_TERMINAL_PROMPT
>            If this environment variable is set to 0, git will not prompt on
>            the terminal (e.g., when asking for HTTP authentication).
>
> Of course that just stops the prompting. If Git needs a credential and
> you don't provide it, then the push will fail.
>
> For advice on that that, try "git help credentials".
>
> -Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-04 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 16:10 disable interactive prompting Ernesto Alfonso
2017-10-04 17:01 ` Jonathan Nieder
2017-10-04 17:09   ` Ernesto Alfonso
2017-10-04 17:05 ` Jeff King
2017-10-04 17:46   ` Ernesto Alfonso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.