Regit
A tool to run changes on a git repository, as if it happened at the time.
Running and Building
This project uses PDM. After installing pdm you should be able to run the script by doing the following:
pdm run python -m regit --help
There are two modes:
Stream mode, every file is given to the process's stdin, and the stdout is used to replace
the content of the file. sed
is used as the tool.
pdm run python -m regit --mapping mapping.csv --pattern '*.md' sed 's/```console/```bash/'
Rewrite mode, every file is changed in-place, use '{}' to represent the file that needs to change:
pdm run python -m regit --mapping mapping.csv --pattern '*.py' -- sed -e 's/def/DEF/' -i '' {}
Contributing
All contributions are accepted under the license in LICENSE.
After your first contribution please add your name to the pyproject.toml
file.
Notes
-
https://git-scm.com/docs/git-commit I can see that there is a
--reuse-message=<commit>
option in git which might be interesting.