1.6 KiB
1.6 KiB
repo-fix
Normalize Dandaedre Gitea submodule URLs after cloning, pulling, or syncing:
.gitmodulesuses HTTPS throughproxy.dandaedre.comfor CI.- Local Git configuration uses SSH through
git.dandaedre.com. - Initialized and nested submodule remotes are updated as well.
The script requires Python 3.10 or newer and Git. It has no runtime Python dependencies and does not fetch repositories or submodules.
Usage
Preview changes first, then apply them:
python3 fix_submodules.py /path/to/repository --dry-run
python3 fix_submodules.py /path/to/repository
The repository path defaults to the current directory and may point anywhere inside a working tree. Repeated runs are safe.
After applying the changes, commit .gitmodules when it changed. Local Git
configuration is intentionally not committed. You can then initialize the
submodules:
git -C /path/to/repository submodule update --init --recursive
Show the current semantic version with:
python3 fix_submodules.py --version
Development
Run the dependency-free unit suite with:
python3 -m unittest discover -s tests -v