{"thread":{"id":"46901","subject":"disable interactive prompting","startedAt":"2017-10-04T16:11:27Z","lastAt":"2017-10-04T17:46:14Z","messageCount":5,"participants":["Ernesto Alfonso","Jonathan Nieder","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"329692","messageId":"87tvzehp13.fsf@gmail.com","threadId":"46901","inReplyTo":null,"subject":"disable interactive prompting","fromName":"Ernesto Alfonso","fromEmail":"erjoalgo@gmail.com","sentAt":"2017-10-04T16:10:48Z","receivedAt":"2017-10-04T16:11:27Z","isPatch":false,"sender":{"key":"erjoalgo@gmail.com","avatar":null},"body":"Hi,\n\nWaiting for git-push synchronously slows me down, so I have a bash\nalias/function to do this in the background. But when my origin is https, I\nget an undesired interactive prompt. I've tried to disable by\nredirecting stdin:\n\ngit push ${REMOTE} ${BRANCH} &>/dev/null </dev/null\n\nbut I still get an interactive prompt.\n\nIs there a way to either\n\n1. disable interactive prompting\n2. programmatically determine whether a git command (or at least a git\npush) would interactively prompt\n\nThanks,\n\nErnesto\n"},{"id":"329695","messageId":"20171004170119.GO19555@aiede.mtv.corp.google.com","threadId":"46901","inReplyTo":"87tvzehp13.fsf@gmail.com","subject":"Re: disable interactive prompting","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-10-04T17:01:19Z","receivedAt":"2017-10-04T17:01:26Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Ernesto,\n\nErnesto Alfonso wrote:\n\n> Waiting for git-push synchronously slows me down, so I have a bash\n> alias/function to do this in the background. But when my origin is https, I\n> get an undesired interactive prompt. I've tried to disable by\n> redirecting stdin:\n>\n> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null\n>\n> but I still get an interactive prompt.\n>\n> Is there a way to either\n>\n> 1. disable interactive prompting\n> 2. programmatically determine whether a git command (or at least a git\n> push) would interactively prompt\n\nYou left out an important detail: what does the interactive prompt in\nquestion say?\n\nThe general question is also interesting, but seeing the particular\nprompt would make it easy to look into the specific case at the same\ntime.\n\nThanks,\nJonathan\n"},{"id":"329696","messageId":"20171004170532.6pjcwdurcokpvcop@sigill.intra.peff.net","threadId":"46901","inReplyTo":"87tvzehp13.fsf@gmail.com","subject":"Re: disable interactive prompting","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-10-04T17:05:32Z","receivedAt":"2017-10-04T17:05:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 04, 2017 at 09:10:48AM -0700, Ernesto Alfonso wrote:\n\n> Waiting for git-push synchronously slows me down, so I have a bash\n> alias/function to do this in the background. But when my origin is https, I\n> get an undesired interactive prompt. I've tried to disable by\n> redirecting stdin:\n> \n> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null\n> \n> but I still get an interactive prompt.\n> \n> Is there a way to either\n> \n> 1. disable interactive prompting\n> 2. programmatically determine whether a git command (or at least a git\n> push) would interactively prompt\n\nI assume the prompt is for credentials, since that's generally the only\nthing git-push will prompt for.\n\nTry:\n\n  $ git help git | sed -ne '/PROMPT/,/^$/p'\n         GIT_TERMINAL_PROMPT\n           If this environment variable is set to 0, git will not prompt on\n           the terminal (e.g., when asking for HTTP authentication).\n\nOf course that just stops the prompting. If Git needs a credential and\nyou don't provide it, then the push will fail.\n\nFor advice on that that, try \"git help credentials\".\n\n-Peff\n"},{"id":"329698","messageId":"87mv56hmbd.fsf@gmail.com","threadId":"46901","inReplyTo":"20171004170119.GO19555@aiede.mtv.corp.google.com","subject":"Re: disable interactive prompting","fromName":"Ernesto Alfonso","fromEmail":"erjoalgo@gmail.com","sentAt":"2017-10-04T17:09:26Z","receivedAt":"2017-10-04T17:09:36Z","isPatch":false,"sender":{"key":"erjoalgo@gmail.com","avatar":null},"body":"Hi,\n\nThe prompt asks for my https username/password:\n\n\n> $ grv\n> origin\thttps://github.com/user/dotemacs (fetch)\n> origin\thttps://github.com/user/dotemacs (push)\n> $ gpom\n> [1] 22549\n> $ Username for 'https://github.com': \n> $ fg\n> { git push origin master &>/dev/null < /dev/null; LAST=$?; test 0 -eq $LAST || echo \"gpom failed with $LAST !\"; }\n> Password for 'https://asd,csd@github.com': \n> gpom failed with 128 !\n> $ \n\n\nThanks,\n\nErnesto\n\nJonathan Nieder <jrnieder@gmail.com> writes:\n\n> Hi Ernesto,\n>\n> Ernesto Alfonso wrote:\n>\n>> Waiting for git-push synchronously slows me down, so I have a bash\n>> alias/function to do this in the background. But when my origin is https, I\n>> get an undesired interactive prompt. I've tried to disable by\n>> redirecting stdin:\n>>\n>> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null\n>>\n>> but I still get an interactive prompt.\n>>\n>> Is there a way to either\n>>\n>> 1. disable interactive prompting\n>> 2. programmatically determine whether a git command (or at least a git\n>> push) would interactively prompt\n>\n> You left out an important detail: what does the interactive prompt in\n> question say?\n>\n> The general question is also interesting, but seeing the particular\n> prompt would make it easy to look into the specific case at the same\n> time.\n>\n> Thanks,\n> Jonathan\n"},{"id":"329699","messageId":"878tgqhkmb.fsf@gmail.com","threadId":"46901","inReplyTo":"20171004170532.6pjcwdurcokpvcop@sigill.intra.peff.net","subject":"Re: disable interactive prompting","fromName":"Ernesto Alfonso","fromEmail":"erjoalgo@gmail.com","sentAt":"2017-10-04T17:46:04Z","receivedAt":"2017-10-04T17:46:14Z","isPatch":false,"sender":{"key":"erjoalgo@gmail.com","avatar":null},"body":"Thanks for pointing out the option. \n\nI tried \"git help push\" and searched for \"prompt\", \"interactive\",\n\"credentials\"...\n\nI don't think I would have figured to try\n \"git help git\" from \"git help\" even after reading it carefully.\n\nI'd suggest adding a hint in \"git help\".\n\nI also don't seem have the GIT_TERMINAL_PROMPT in \"git version 1.8.3.1\" but I can fix this.\n\nThanks,\n\nErnesto\nJeff King <peff@peff.net> writes:\n\n> On Wed, Oct 04, 2017 at 09:10:48AM -0700, Ernesto Alfonso wrote:\n>\n>> Waiting for git-push synchronously slows me down, so I have a bash\n>> alias/function to do this in the background. But when my origin is https, I\n>> get an undesired interactive prompt. I've tried to disable by\n>> redirecting stdin:\n>> \n>> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null\n>> \n>> but I still get an interactive prompt.\n>> \n>> Is there a way to either\n>> \n>> 1. disable interactive prompting\n>> 2. programmatically determine whether a git command (or at least a git\n>> push) would interactively prompt\n>\n> I assume the prompt is for credentials, since that's generally the only\n> thing git-push will prompt for.\n>\n> Try:\n>\n>   $ git help git | sed -ne '/PROMPT/,/^$/p'\n>          GIT_TERMINAL_PROMPT\n>            If this environment variable is set to 0, git will not prompt on\n>            the terminal (e.g., when asking for HTTP authentication).\n>\n> Of course that just stops the prompting. If Git needs a credential and\n> you don't provide it, then the push will fail.\n>\n> For advice on that that, try \"git help credentials\".\n>\n> -Peff\n"}]}