Extend housekeeping feature with `git prune`
Today, while pushing changes to the GitLab CE repo, we saw a warning:
(...)
Total 18 (delta 17), reused 0 (delta 0)
error: The last gc run reported the following. Please correct the root cause and remove gc.log.
Automatic cleanup will not be performed until the file is removed.
warning: There are too many unreachable loose objects; run 'git prune' to remove them.
To git@gitlab.com:gitlab-org/gitlab-ce.git
(...)
It looks like git gc
sometimes can't handle unreachable objects. gc
is executed automatically by some git commands and can be executed by our housekeeping feature. But in such situation it probably won't help.
My proposition is to add to the housekeeping - as an option (e.g. a checkbox in settings page) - execution of git prune
inside of the repository. As for now we can do it only by logging on the server by SSH and executing it manually.
This of course entail an update in the gitlab-shell.