- Writing custom git flow scripts - a start

This commit is contained in:
Josako
2025-12-11 09:27:21 +01:00
parent 0f8bda0aef
commit fe9fc047ff
14 changed files with 720 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from __future__ import annotations
from ..core import config, git_api, output
def handle_status(args) -> int: # noqa: ARG001 - argparse API
"""Toon huidige branch en eenvoudige status-info."""
try:
branch = git_api.get_current_branch()
except git_api.GitError as exc:
output.error(str(exc))
return 1
clean = git_api.is_clean_working_tree()
output.heading("Repo status")
output.plain(f"Huidige branch : {branch}")
output.plain(f"Working tree : {'clean' if clean else 'NIET clean'}")
# Optionele remote-checks
cfg = config.CONFIG
for important_branch in {cfg.main_branch, cfg.develop_branch, branch}:
try:
git_api.ensure_not_behind_remote(important_branch, cfg.remote_name)
except git_api.GitError as exc:
output.warning(str(exc))
return 0