Skip to content

Can MR !1218 stop hardcoding "-c" options for "git gc"?

The code added in !1218 (merged) changes the "git gc" gitaly runs to "git -c gc.writeCommitGraph=true" (also core.commitGraph=true (or it meant to), but see my !1223 (edit: !1224 (merged))).

Now, as noted in https://gitlab.com/gitlab-org/gitlab-ce/issues/42349#note_98697440 I'm probably the last person who'll be turning it off.

But I was wondering in general if there's a way we can have gitaly run stuff like "git gc" without hardcoding gc.* options, because I'd like to sometimes tweak/change them from the defaults.

I suspect you're doing this because gitaly might run on both /usr/bin/git and the omnibus git, in the latter case you can just stick the config in /opt/gitlab/embedded/etc/gitconfig, but not the former.

If that's the case maybe there's some way gitaly can add this to its omnibus gitconfig, then detect if it's using the ombinus git and not hardcode this?

CC: @pokstad1 @zj

Edited by Ævar Arnfjörð Bjarmason
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information