straight.el
straight.el copied to clipboard
Prompt for SSH/HTTPS passphrase in minibuffer
(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.
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.
Better late than never, right? :sparkles:
Unfortunately, I just noticed that this causes a regression in process execution sequencing. More work is required.
:sparkles: :sparkles: :sparkles:
Another regression, this one even more incomprehensible. This makes me extremely sad.
If you
(setq straight-vc-git-default-protocol 'ssh)then you can take advantage of
ssh-agentauthentication. With HTTPS, you can usegit-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.
You can also accomplish this by running M-x straight-normalize-all with straight-vc-git-force-protocol non-nil.