As the subject asks. I am attempting to set up Gitolite for personal use, and I want to have newer Git features enabled. I have added the following to gitolite.conf:
repo @all
config core.repositoryFormatVersion = 1
config extensions.objectFormat = sha256
config extensions.compatObjectFormat = sha1
config init.defaultBranch = main
config init.defaultObjectFormat = sha256
repo gitolite-admin
RW+ = shadow53
config core.repositoryFormatVersion = 0
config extensions.objectFormat = ""
config extensions.compatObjectFormat = ""
repo u/CREATOR/..*
C = @all
RW+ = CREATOR
RW = WRITERS
R = READERS
If I attempt to create a repo by cloning, I get the following output:
$ git clone g...@git.shadow53.dev:u/shadow53/test.git
Cloning into 'test'...
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in /usr/local/git/repositories/u/shadow53/test.git/
warning: repo version is 0, but v1-only extension found:
compatobjectformat
BUG: repository.c:193: hash_algo and compat_hash_algo match
BUG: repository.c:193: hash_algo and compat_hash_algo match
BUG: repository.c:193: hash_algo and compat_hash_algo match
error: git-shell died of signal 6
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I get a similar error if I try to create the repository by pushing a local repo:
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in /usr/local/git/repositories/u/shadow53/notes.git/
Enumerating objects: 34, done.
Counting objects: 100% (34/34), done.
Delta compression using up to 16 threads
Compressing objects: 100% (31/31), done.
Writing objects: 100% (34/34), 155.18 KiB | 17.24 MiB/s, done.
Total 34 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
remote: error: unable to map tree f6ecb60cdb7c3ab2efe6fabbf9655afb2124f3eabe75cff98c930a5440ab36f7 in commit object
remote: fatal: Failed to convert object from sha256 to sha1
error: remote unpack failed: unpack-objects abnormal exit
! [remote rejected] main -> main (unpacker error)
In other words, it looks like the configuration is not applied until after the repository is created. So, my question boils down to: is there a supported way to set default configuration before a repo is created?
As a separate note, the repo's config file on the server seems like it has most of the config options set, but "extensions.objectFormat" is missing:
[core]
repositoryFormatVersion = 1
filemode = true
bare = true
[init]
defaultBranch = main
[extensions]
compatObjectFormat = sha1
I'm not sure if there's logic internal to gitolite preventing it from being set, but I believe this is the cause of "BUG: repository.c:193: hash_algo and compat_hash_algo match" above. I have "GIT_CONFIG_KEYS" equal to '.*', so I don't think my configuration is causing it to be ignored.
Thanks in advance,
Michael Bryant (Shadow53)