Run commands on different git repo versions.
gitstorical
is a command-line tool that allows you to run a command on different versions (tags) of a git repository. It provides a way to analyze or compare the output of the same command across various points in the repository's history.
go install github.com/tomas-bareikis/gitstorical@latest
List all files in the repository on each tag:
gitstorical --gitURL https://github.com/go-git/go-git \
--command ls tags
Print the output in jsonl format:
gitstorical --gitURL https://github.com/go-git/go-git \
--command ls \
--outputFormat jsonl tags
Run only on tags newer than v5:
gitstorical --gitURL https://github.com/go-git/go-git \
--command ls \
--outputFormat jsonl tags \
--tagFilter '>v5.0.0'
Checkout git repository to specific location. If a git repo already exists in the that location, it will not be overwritten.
gitstorical --checkoutDir /tmp/gitstorical/go-git \
--gitURL https://github.com/go-git/go-git \
--command ls \
--outputFormat jsonl \
tags --tagFilter '>v5.0.0'