Open kfkonrad opened 1 month ago
What is the url remote for the git repo? Sometimes git handles things differently depending on the protocol. For example, ssh remotes never respect the credential helper value, even in git.
Does plan git fetch
respect the config variable and its just jj that fails?
The URL is https://gitlab.com/foo/bar.git
jj
only fails (i.e. falls back to asking for credentials interactively) if none are set for the given host in the credential helper. git fetch
also asks for credentials interactively if none are set for the given host but it stores them using the credential helper afterwards
Since jj
doesn't store the credentials if none are found it asks for them every time. Calling git fetch
once fixes that (because git fetch
stores the credentials which jj
will then read and use as expected) but I'd expect jj
to not be dependent on running plain git
commands
Description
I tried using jj with a
credential.helper
set in my global gitconfig as per the documentation. I ranjj git fetch
and was asked for username and password.Then I tried doing a
git fetch
for the same host and entered my credentials. After that they were stored in the credential store andjj
was able to retrieve them. They weren't in there before then because I normally use ssh or the VS CodeGIT_ASKPASS
. (SupportingGIT_ASKPASS
might be worth discussing as well, but that's out of scope for this issue.)Somewhat relatedly I found the documentation for
credential.helper
confusing (in git-compatibility). I'd suggest wording it more clearly that this is read from the default gitconfig as opposed tojj
's config like almost every other setting. Also on the same page the first listed supported feature mentions which git settings will be taken into account when using jj. Addingcredential.helper
to that list would help clear up the wordingSteps to Reproduce the Problem
jj
repo (a colocated is easiest, but any backed by git will do)git config --global credential.helper osxkeychain
(using your OS's helper)jj git fetch
Expected Behavior
jj
should either:inform the user that no entry was found for the given host and instruct them to add one using git or the credential helper itself
OR
add the entry using the helper and inform the user that it is doing so.
Actual Behavior
jj
silently falls back to asking for username/password interactively and does not store the credentials using the helper.Specifications
Let me know if I can be of help in resolving the issue (such as submitting an update to the docs as a PR)