Skip to content

jj can't set up new git credential.helper entries #4101

@kfkonrad

Description

@kfkonrad

Description

I tried using jj with a credential.helper set in my global gitconfig as per the documentation. I ran jj 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 and jj was able to retrieve them. They weren't in there before then because I normally use ssh or the VS Code GIT_ASKPASS. (Supporting GIT_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 to jj'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. Adding credential.helper to that list would help clear up the wording

Steps to Reproduce the Problem

  1. Be in a jj repo (a colocated is easiest, but any backed by git will do)
  2. Run git config --global credential.helper osxkeychain (using your OS's helper)
  3. Make sure there's no entry for the git host configured
  4. Run 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

  • Platform: macOS 14.5 on Apple Silicon (arm64)
  • Version: 0.19.0

Let me know if I can be of help in resolving the issue (such as submitting an update to the docs as a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions