[go: up one dir, main page]

Skip to content

git-annex-shell integration initializes repo before running git-annex-shell, breaking gcryptsetup

In line 70 of gitlab_shell.rb¸I see:

# Make sure repository has git-annex enabled
init_git_annex(@repo_name)

This line is the root cause of the bug described at http://git-annex.branchable.com/gitlab_repos_cannot_use_gcrypt/

Specifically, to support gcrypt, git-annex-shell is run with the gcryptsetup parameter. When run with this parameter, it expects to find a repository that has not had git-annex initialized in it. But, gitlab-shell arranges for git-annex init to be run first, which prevents this from working as it's supposed to.

It may be that doing this manual git-annex init in gitlab-shell simplified the workflow described in gitlab-ee/doc/workflow/git_annex.md. While git-annex-shell will automatically initialize a repository for git-annex use, it only does this after a git-annex branch has been pushed to the repository. This can make the initial workflow a bit tricky, and is something I will investigate improving in git-annex-shell. See http://git-annex.branchable.com/todo/better_git-annex-shell_init_workflow/

So, I don't necessarily think you should remove the init_git_annex call.. Although that would fix this bug. A more nuanced fix would be to check if git-annex-shell is being run with a "gcryptsetup" parameter, and avoid calling init_git_annex in that case.