docs: def get_git_cleaned_branch_name(path):
      """Get the git branch name of the current HEAD in path. The branch name is
      scrubbed to conform to PEP-440.
  
      PEP-440 Local version identifiers shall only consist out of:
      - ASCII letters ( [a-zA-Z] )
      - ASCII digits ( [0-9] )
      - periods ( . )
      https://www.python.org/dev/peps/pep-0440/#local-version-identifiers
  
      Parameters
      ----------
      path: str
          The path to run git commands in.
      """
      # Get name of current branch (or 'HEAD' for a detached HEAD)
      branch_name = run_cmd(path, 'git', 'rev-parse', '--abbrev-ref', 'HEAD')
      branch_name = re.sub(r"[^A-Za-z0-9]+", ".", branch_name.strip())
      return branch_name