Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions git_why.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import sys
from fnmatch import fnmatch

__version__ = "0.1.0" # single source of truth; keep in sync with pyproject.toml

KEYS = ["Why", "Why-Prompt", "Why-Rationale", "Why-Alternatives",
"Why-Spec", "Why-Agent", "Why-Session", "Why-Confidence"]
LABEL = {"Why-Prompt": "prompt", "Why-Rationale": "rationale",
Expand Down Expand Up @@ -425,6 +427,9 @@ def cmd_init(args):

def main():
argv = sys.argv[1:]
if argv and argv[0] in ("-V", "--version"):
print(f"git why {__version__}")
return 0
if not argv or argv[0] not in SUBCOMMANDS:
if argv and argv[0] in ("-h", "--help"):
return cmd_show("-h")
Expand Down
3 changes: 3 additions & 0 deletions test/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ git config user.email t@example.com
git config user.name Tester
big() { printf '%s line %s\n' "$1" $(seq 1 40) > "$1"; git add "$1"; }

# --- version ---------------------------------------------------------------
gw --version | grep -qE "^git why [0-9]+\.[0-9]+" || fail "git why --version"

# ---- default: nudge (never blocks) -------------------------------------
gw init >/dev/null
[ "$(git config --get why.strict)" = "nudge" ] || fail "default level is not nudge"
Expand Down