Coding 2023-09-30
Sometimes I have simple desires with complicated realizations. Like, what does it take for me to be able to get away with using Mercurial as a GitHub client? One thing I want is Mercurial support in towncrier, which I have in a fork that is probably woefully out-of-date.
Somewhat more generally used, however, is pre-commit. If I could install the pre-commit hooks in a clone made with hg-git, that'd be the dream. Looking at the way the internal git module is used within the pre-commit repository...
- main.py: git.get_root, git.check_for_cygwin_mismatch
- story.py: git.init_repo, no_git_env
- staged_files_only.py: get.intent_to_add_files
- commands/run.py: git.get_changed_files, git.get_all_files, git.is_in_merge_conflict, git.get_conflicted_files, git.get_staged_files
- commands/autoupdate.py: git.init_repo, git.get_best_candidate_tag
- commands/try_repo.py: git.head_rev, git.git_path, git.get_staged_files, git.commit
- meta_hooks/check_hooks_apply.py: git.get_all_files
- meta_hooks/check_useless_excludes.py: git.get_all_files
- commands/install_uninstall.py: git.get_git_common_dir, git.has_core_hookpaths_set
But also a bunch of places that use git inline...
In addition, there are the questions of how to translate between "hooks are script files" and "hooks are configuration entries", and between different hook names.
Unfortunately, it's late now. I'll see what I can get planned to do tomorrow.
Good night.