Skip to content
Snippets Groups Projects
Select Git revision
  • aa16313077f871dbac83bbe78350ca7ca9eee78d
  • main default
2 results

midterm2023b

  • Clone with SSH
  • Clone with HTTPS
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.

    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