post_fetch.py 519 B

123456789101112131415161718
  1. from __future__ import annotations
  2. import configparser
  3. def main(context: dict[str, str]) -> int:
  4. # post_fetch is meant for recommended but not required defaults
  5. reporoot = context["reporoot"]
  6. git_config = configparser.ConfigParser()
  7. git_config.read(f"{reporoot}/.git/config")
  8. git_config["blame"] = {"ignoreRevsFile": ".git-blame-ignore-revs"}
  9. git_config["branch"] = {"autosetuprebase": "always"}
  10. with open(f"{reporoot}/.git/config", "w") as f:
  11. git_config.write(f)
  12. return 0