openwrt-mesh-builder/tools/git_utils.py
Khachatryan Karen 37ae488db2 Initial commit
2026-07-04 00:08:35 +03:00

16 lines
390 B
Python
Executable file

#!/usr/bin/env python3
"""Small Git helpers backed by the `git` Unix tool."""
import sys
sys.dont_write_bytecode = True
from pathlib import Path
try:
from .process import output_or_none
except ImportError:
from process import output_or_none
def git_short(cwd: Path | None = None) -> str:
return output_or_none(["git", "rev-parse", "--short", "HEAD"], cwd=cwd) or "unknown"