investigate how to use git credential fill
based on https://github.com/extrawurst/gitui/issues/800#issuecomment-1019589351
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.
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.
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
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.
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.
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
https://github.com/rust-lang/git2-rs/pull/1006