git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git GUI vs interactive post-commit hooks

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
May 22, 2008, 15:12 UTC
Message-ID
<20080522151246.GA9765@atjola.homenet>
In-Reply-To
<20080522125301.GD3206@steel.home>
On 2008.05.22 14:53:01 +0200, Alex Riesen wrote:
Show 34 quoted lines
> Björn Steinbrink, Wed, May 21, 2008 01:02:04 +0200:
> > On 2008.05.21 00:31:58 +0200, Alex Riesen wrote:
> > > Bj?rn Steinbrink, Mon, May 19, 2008 15:19:42 +0200:
> > > > On 2008.05.19 14:48:14 +0400, Alexander Gladysh wrote:
> > > > > 
> > > > > Any advice? I do want to input password for my key each time I use it.
> > > > 
> > > > For a graphical tool, you might want to use something like
> > > > gtk-led-askpass, which shows a window with a password prompt. SSH will
> > > > make use of it if SSH_ASKPASS contains its path _and_ ssh is not started
> > > > from a terminal. Unfortunately, the latter is probably not true for git
> > > > gui most of the time.
> > > 
> > > Redirect stdin from /dev/null
> > 
> > Does that actually work for you? It didn't work for me, because ssh then
> > simply goes and opens /dev/tty to ask for the password.
> > 
> > $ ssh -V
> > OpenSSH_4.7p1 Debian-10, OpenSSL 0.9.8g 19 Oct 2007
> > 
> 
> No :( I took this information from sshs manpage:
> 
>      SSH_ASKPASS           If ssh needs a passphrase, it will read the
>                            passphrase from the current terminal if it was run
>                            from a terminal.  If ssh does not have a terminal
>                            associated with it but DISPLAY and SSH_ASKPASS are
>                            set, it will execute the program specified by
>                            SSH_ASKPASS and open an X11 window to read the
>                            passphrase.  This is particularly useful when call‐
>                            ing ssh from a .xsession or related script.  (Note
>                            that on some machines it may be necessary to redi‐
>                            rect the input from /dev/null to make this work.)

Yeah, that got me trying the redirection, too. But the "If ssh does not have a terminal associated" part is actually what counts, it seems. Because ssh falls back to /dev/tty if stdin doesn't work. Guess the stdin redirect might just be required in some cases, where it would use /dev/stdin directly, so you force it to try /dev/tty and then use SSH_ASKPASS.

Björn
Previous: Alex Riesen
Message 9 of 9 in “Git GUI vs interactive post-commit hooks”
  1. Alexander GladyshMay 19, 2008
  2. Björn SteinbrinkMay 19, 2008
  3. Alexander GladyshMay 19, 2008
  4. Björn SteinbrinkMay 19, 2008
  5. Alex RiesenMay 20, 2008
  6. Björn SteinbrinkMay 20, 2008
  7. Jeff KingMay 20, 2008
  8. Alex RiesenMay 22, 2008
  9. Björn SteinbrinkMay 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.