-
Extract the database to
data/git.duckdbmkdir data/ mv ~/Downloads/git.duckdb.gz data/ gunzip data/git.duckdb.gz -
Install dependencies and start Streamlit
poetry install poetry run streamlit run Recent.py
OR if you don't want to install Python, there's a
Dockerfileand/or adocker-compose.ymltoo, although it seems to run somewhat slower, perhaps due to the default cgroups limits? DuckDB seems rather hungry for resources.docker compose build docker compose up
-
Update your .ssh config - I use this config for multiplexing to speed up cloning
Host redmine-git User git HostName redmine.mgmtprod Port 2223 IdentityFile ~/.ssh/id_rsa ControlPath ~/.ssh/connections/%r@%h.ctl ControlMaster auto ControlPersist 10m IdentitiesOnly yes
-
Create an
.envin this directoryexport GITLAB_HOST=gitlab.mgmtprod export GITLAB_USER=<username> export GITLAB_TOKEN=<personal access token> export GITLAB_ROOT="${HOME}/repos/gitlab" export GITOLITE_HOST="redmine-git" export GITOLITE_ROOT="${HOME}/repos/gitolite"
If necessary, create the GitLab personal access token first.
-
The indexing process happens in four steps:
- repository discovery (
poetry run python discover_gitlab.pyanddiscover_gitolite.py)- this produces
data/repos-*.csv
- this produces
- cloning (or fetching) the repositories (
fetch_known_repos.py)- this produces bare repositories in
GITLAB_ROOTandGITOLITE_ROOT - I have, in the past, used
git worktreeto work with bare repos locally toogit -C ~/repos/gitlab/odoo/odoo.git worktree add ~/work/odoo maingit -C ~/work/odoo commitrm -rf ~/work/odoogit -C ~/repos/gitlab/odoo/odoo.git worktree prune
- this produces bare repositories in
- indexing the repositories by parsing the output of
git ls-treeandgit log --numstat- produces
data/git_*.csv
- produces
- and lastly loading the CSVs into a DuckDB database
- produces
data/git.duckdb - to be compressed into
data/git.duckdb.gzusinggzip -k data/git.duckdb - originally, this project ran on PostgreSQL
- but DuckDB is useful for a workshop format, and for sharing the DB index in general
- produces
- repository discovery (