I know I give the Python code as a string in the command line for example as:
git-filter-repo --name-callback 'return name.replace(b"Wiliam", b"William")'
but especially as I get into more complex scripts, this will get very clumsy.
Rather, is there a way to do something like:
main.py
import git_filter_repo
def name_callback(name):
return name.replace(b"Wiliam", b"William")
git_filter_repo.name_callback(name_callback)
The project README mentions that it can be used as a library, and I managed to install the Python package with:
python3 -m pip install --user git-filter-repo
but I couldn't easily find documentation on how to do a hello world with the Python API.