Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt for SSH/HTTPS passphrase in minibuffer #334

Open
qleguennec opened this issue Dec 15, 2018 · 7 comments
Open

Prompt for SSH/HTTPS passphrase in minibuffer #334

qleguennec opened this issue Dec 15, 2018 · 7 comments

Comments

@qleguennec
Copy link

qleguennec commented Dec 15, 2018

(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.

@raxod502
Copy link
Member

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 raxod502 added this to the 1.0 milestone Dec 16, 2018
@raxod502 raxod502 changed the title Support fetching a package from a private github repository Prompt for SSH/HTTPS passphrase in minibuffer Jun 5, 2019
@raxod502
Copy link
Member

Better late than never, right? ✨

raxod502 added a commit that referenced this issue Sep 13, 2019
This reverts commit 92ef5cc. It was
found to cause an issue where `straight--process-run' could return
before the process had actually exited.
@raxod502
Copy link
Member

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

@raxod502 raxod502 reopened this Sep 13, 2019
raxod502 added a commit that referenced this issue Sep 13, 2019
This reverts commit 00ee2d4, and
includes an additional change to make sure `straight--process-run'
does not return before the process actually exits.
@raxod502
Copy link
Member

✨ ✨ ✨

raxod502 added a commit that referenced this issue Sep 16, 2019
This reverts commit f18e581 because
oh-so-tragically there's a much more subtle regression in it where
sometimes no matter how long we spin in `accept-process-output' Emacs
just decides to never pass control to the process sentinel (until we
interrupt execution, anyway).
@raxod502
Copy link
Member

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

@bestlem
Copy link

bestlem commented Jun 18, 2022

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.

@raxod502
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants