diff --git a/howto/git.md b/howto/git.md index d37ab3f844a32923cf22fd011f5f50c5b771f4b4..482a9c62ab8faba6c97a127ce155fabc32158aab 100644 --- a/howto/git.md +++ b/howto/git.md @@ -242,6 +242,49 @@ Some repositories are mirrored to https://github.com/torproject organization and to the https://gitlab.torproject.org/ server, through gitlite hooks. +## Archiving a repository + +To archive a repository, it must first be deactivated by adding a +`pre-receive` hook, e.g. in: + + /srv/git.torproject.org/repositories/PROJECT.git/hooks/pre-receive + +The script should display some sort of warning and exit with an error, +for example: + + #!/bin/sh + + cat <<EOF + This repository is deprecated and should not be used anymore. + + See this issue for details: + + https://gitlab.torproject.org/tpo/tpa/team/-/issues/9999999 + EOF + + exit 1 + +Then in Gitolite, the repository must be put "in the Attic", using a +patch that looks something like this: + +``` + repo project/foo + RW = anarcat +- config gitweb.category = Old category +-project/foo "The Tor Project" = "foo project" ++ config gitweb.category = Attic ++project/foo "The Tor Project" = "foo project (deprecated)" + + repo project/bar + RW = @jenkins-admins +``` + +The `description` file in the repository should also be updated +similarly. + +Note that repos can also be migrated (and archived) to GitLab, see +[the GitLab migration procedure](gitlab/#how-to-migrate-a-git-repository-from-legacy-to-gitlab) for details. + ## Admin details git-rw runs on `cupani.torproject.org` and runs as the git user. Users in the