git-annex/doc/bugs/safe.bareRepository_breaks_git-annex_uuid.mdwn
Joey Hess a05bc6a314
Fix breakage when git is configured with safe.bareRepository = explicit
Running git config --list inside .git then fails, so better to only
do that when --git-dir was specified explicitly. Otherwise, when the
repository is not bare, run the command inside the working tree.

Also make init detect when the uuid it just set cannot be read and fail
with an error, in case git changes something that breaks this later.

I still don't actually understand why git-annex add/assist -J2 was
affected but -J1 was not. But I did show that it was skipping writing to
the location log, because the uuid was NoUUID.

Sponsored-by: Graham Spencer on Patreon
2023-07-05 14:43:14 -04:00

21 lines
720 B
Markdown

Turns out that git-annex breaks badly when git is configured with
`safe.bareRepository = explicit`.
The breakage starts with git-annex init:
joey@darkstar:~/tmp>git init g
Initialized empty Git repository in /home/joey/tmp/g/.git/
joey@darkstar:~/tmp>cd g
joey@darkstar:~/tmp/g>git-annex init
init ok
(recording state in git...)
joey@darkstar:~/tmp/g>git show git-annex | tail
+ joey@darkstar:~/tmp/g timestamp=1688579729.946567508s
uuid.log has a NoUUID item logged to it. This is despite annex.uuid being set.
This is because git-annex runs `git config --list`
inside `.git`.. Which with that config set, omits looking at
`config` because it thinks it's in a bare repository.
> [[fixed|done]] --[[Joey]]