I'm having a major problem with one of my important annexes.
I'm mounting my "centralized" remote via sshfs. The remote is bare format.
I have tried removing it and adding it, making sure not to have a trailing / just in case. So:
git remote add mybare /centralized-bare.git
But no matter what I do, I can't get annex to stop appending "/.git" to the path. So that I see something like this:
$ git annex info fatal: not a git repository: '../../../../mnt/sshfs/centralized-bare.git/.git'
First run: git-annex init trusted repositories: 0
It's rendering it invisible and breaking using the centralized remote as that important fulcrum.
Any ideas?
This is a desperately impactful issue. Obviously, for whatever reason, git-annex is deciding that the path to the bare remote is to a "workarea", and not a bare .git...
Can someone shed light on the various gates that get to this point? What's being checked in what order (are permissions checked??? is a directory test being applied???)
Apologies... I just realised that perhaps I shouldn't have had such confidence in the version of git-annex I'm running.
On the system I'm experiencing the issue, I'm running 8.20200226-1. I had assumed that the release of Linux I was running had a a more up-to-date version.
I'm performing some upgrades, and expecting that the later version of git-annex works better. Will comment post all this.
Unfortunately, the new version is no better:
git-annex version: 8.20210223
I'll see how far I can go with my own debugging for the moment..
After learning rudimentary Haskell, compiling and tracing git-annex, I stumbled on the root cause. And thankfully, it's not in git-annex.
It appears that at some point git introduced the notion of validation of the "safety" of git directories.
I first validated what I was seeing from an strace. That chdir() to the remote, and running git config --null --list was returning only the global config, and not the local config with core.bare set to true.
In confusion, thankfully my thoughts turned to git remote as a command that lived exclusively in "git config" space, and ran git remote show. When I did, I encountered a "googleable" error message:
And I was off to the races again.
It is a shame that the git config command itself doesn't throw that same error. The silent continuation in this case, was quite fatal to operations.
Hmm, git-annex dealt with this change to git back in version 10.20220525.
But, it seems it didn't deal with this specific case of a bare repo used as a remote. Opened a bug: bare remote safe directory