straight.el icon indicating copy to clipboard operation
straight.el copied to clipboard

Prompt for SSH/HTTPS passphrase in minibuffer

Open qleguennec opened this issue 6 years ago • 7 comments
trafficstars

(use-package private-repo
  :straight (:host github :repo "qleguennec/private-repo"))

Results in:

$ cd /home/void/.emacs.d/straight/repos/
$ git clone --origin origin --no-checkout https\://github.com/qleguennec/private-repo.git private-repo

Cloning into 'private-repo'...
fatal: could not read Username for 'https://github.com': No such device or address

[Return code: 128]

Not sure if that's a bug or something that could be implemented. Either way, that would be pretty useful to have.

qleguennec avatar Dec 15 '18 15:12 qleguennec

If you

(setq straight-vc-git-default-protocol 'ssh)

then you can take advantage of ssh-agent authentication. With HTTPS, you can use git-credential-cache.

Unfortunately, if the cache has timed out, you still get an error like this. I agree that it's not desirable behavior. Probably the right way to handle this is to do as Magit does and just connect stdin for all Git commands to the terminal. That way the user can provide a passphrase when one is needed.

raxod502 avatar Dec 16 '18 16:12 raxod502

Better late than never, right? :sparkles:

raxod502 avatar Sep 13 '19 05:09 raxod502

Unfortunately, I just noticed that this causes a regression in process execution sequencing. More work is required.

raxod502 avatar Sep 13 '19 05:09 raxod502

:sparkles: :sparkles: :sparkles:

raxod502 avatar Sep 13 '19 16:09 raxod502

Another regression, this one even more incomprehensible. This makes me extremely sad.

raxod502 avatar Sep 16 '19 00:09 raxod502

If you

(setq straight-vc-git-default-protocol 'ssh)

then you can take advantage of ssh-agent authentication. With HTTPS, you can use git-credential-cache.

Unfortunately, if the cache has timed out, you still get an error like this. I agree that it's not desirable behavior. Probably the right way to handle this is to do as Magit does and just connect stdin for all Git commands to the terminal. That way the user can provide a passphrase when one is needed.

When you do this chnage to straight-vc-git-default-protocol not you have to also change the [remote] entries in the .git/config from https to ssh for those repos you already have.

bestlem avatar Jun 18 '22 19:06 bestlem

You can also accomplish this by running M-x straight-normalize-all with straight-vc-git-force-protocol non-nil.

raxod502 avatar Jun 20 '22 21:06 raxod502