Please describe the problem.
My ~/.git-credentials file has several lines like this
https://xxx:yyy@api-zzz.falsifian.sandcats.io
which git uses to access some remotes at falsifian.sandcats.io over https, including remotes for some git-annex repositories. (The use of https is due to technical limitation in the Sandstorm software that is hosting the git repositories.)
Ocasionally, running a git-annex command will cause one of those lines to disappear, which breaks my access to all the git remotes under the corresponding hostname (git starts asking for a password).
I think the command that most recently caused it is git annex sync sandstorm
; sandstorm
is the name of one of those remotes. In fact, maybe that's the only command that causes this behaviour; I'm not sure. It only happens once in a while.
Even when git-annex doesn't delete one of those lines, I still sometimes see the lines get re-ordered, so ~/.git-credentials
is being edited for some reason unknown to me.
I have this in ~/.gitconfig:
[credential]
helper = store
What steps will reproduce the problem?
I haven't been able to reproduce it consistently. My best guess is it occasionally happens when I run git annex sync sandstorm
where "sandstorm" is a remote depending on some line in ~/.git-credentials
.
If someone could give me a clue about why git annex sync
would result in ~/.git-credentials
being edited, that might help me dig deeper.
What version of git-annex are you using? On what operating system?
Most recently observed with git-annex 8.20201116 on NixOS. I think I've also seen it on OpenBSD with git-annex 8.20200815-g55c156a53 (built from source).
Please provide any additional information below.
I don't have a transcript that would illustrate the problem, but the behaviour is visible as a git prompt appearing (graphical or on CLI) asking me for a password to log into the git remote.
Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
It works beautifully, other than occasionally clobbering ~/.git-credentials
done as this is apparently not a git-annex bug and the submitter never followed up with any info about what caused it. --Joey
git-annex does not contain the name of this file in its source code.
In a few places git-annex uses
git credential
to ask for a credential. Only in the git-lfs special remote does it evergit credential reject
if the provided credential does not work, which would remove it. Since you are apparently not using that special remote, it does not seem relevant, but also when git-annex does that, it's using it correctly to reject a non-working credential.It may be that git-annex ought to be calling
git credential approve
after it's used the credential. It seems possible git might in some situation or configuration choose to delete a credential that has not been recently approved. The docs are not very clear about this, but I have not been able to reproduce it behaving that way in some tests.Or this deletion could be a git bug, or git could be sometimes seeing the credential not work, for whatever reason, and so removing it.
git credential fill
andgit credential approve
is causing this. If I have more time I'll fiddle with those commands.