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

investigate how to use git credential fill #1094

Open
extrawurst opened this issue Jan 23, 2022 · 6 comments
Open

investigate how to use git credential fill #1094

extrawurst opened this issue Jan 23, 2022 · 6 comments

Comments

@extrawurst
Copy link
Owner

based on #800 (comment)

would be nice if we could fallback to run git credential fill cause it works (at least) on macOS by checking keychain without any explicit credential.helper being defined.

problem is: it does an interactive shell when no credentials are defined. either we figure out how to surpress this or how we can query first if there are credentials defined.

@extrawurst extrawurst added this to the v0.21 milestone Jan 25, 2022
@stale
Copy link

stale bot commented Jul 30, 2022

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Jul 30, 2022
@extrawurst extrawurst modified the milestones: v0.21, v0.22 Aug 17, 2022
@stale stale bot removed dormant Marked by stale bot on close labels Aug 17, 2022
@extrawurst extrawurst modified the milestones: v0.22, v0.23 Oct 20, 2022
@cruessler
Copy link
Contributor

I did a little bit of research, and as far as I can tell, there seems to be no easy way to use git credential in non-interactive mode, or to find out whether specific credentials exist.

https://git-scm.com/docs/git-credential
https://stackoverflow.com/questions/51803825/how-one-may-check-whether-credential-manager-in-git-has-password-stored-for-a-gi

@extrawurst extrawurst removed this from the v0.23 milestone Apr 22, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Dec 15, 2023
@Black616Angel
Copy link

Since I just completely borked my gitconfig, creating a SIGSEGV, I had a look into it.
Looks like you can circumvent the interactive shell by piping the data into git credential fill like this:

echo 'protocol=https
host=example.com
path=test.git' | git credentials fill

This gave me the following output:

protocol=https
host=example.com
username=user
password=secret

Unfortunately I don't know, where to implement that, since I just today found out about gitui, but maybe I will look into it later.

@stale stale bot removed the dormant Marked by stale bot on close label Jan 4, 2024
@extrawurst
Copy link
Owner Author

we are using git2-rs wich call the helper under the hood. feel free to contribute there: https://github.com/rust-lang/git2-rs/blob/master/src/cred.rs#L193

@Black616Angel
Copy link

rust-lang/git2-rs#1006

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

No branches or pull requests

3 participants