Skip to content

Commit ebebe86

Browse files
committed
fix: remove --rollover CLI flag, keep it config-only
Rollover is now activated exclusively via AICOMMIT_ROLLOVER env var or ~/.aicommitrc config file. No CLI flag.
1 parent 43224e9 commit ebebe86

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,9 @@ component never has a max:
111111
| `X.Y` | Y max 10 | `1.9` + patch → `2.0` |
112112
| `X` | no max | `9` + patch → `10` |
113113

114-
The feature is **off by default**. Enable it per run, per shell, or persistently:
114+
The feature is **off by default**. Enable it per shell or persistently:
115115

116116
```bash
117-
# Per run
118-
aicommit --release --rollover
119-
120117
# Per shell / CI
121118
export AICOMMIT_ROLLOVER=true
122119

aicommit

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ show_help() {
106106
echo -e " ${C_DIM}If omitted, AI auto-detects the bump type.${C_RESET}"
107107
echo -e " ${C_GREEN}--remap${C_RESET} Re-run AI version-file discovery and regenerate"
108108
echo -e " ${C_DIM}.aicommit/bump-version.sh for this project.${C_RESET}"
109-
echo -e " ${C_GREEN}--rollover${C_RESET} Enable version rollover: components that reach their"
110-
echo -e " ${C_DIM}max carry into the next one (X.Y.Z: Y max 10, Z max 100;${C_RESET}"
111-
echo -e " ${C_DIM}X.Y: Y max 10; X: no max). Off by default.${C_RESET}"
112109
echo -e " ${C_GREEN}--update${C_RESET} Update aicommit to the latest release from GitHub."
113110
echo -e " ${C_GREEN}-v${C_RESET}, ${C_GREEN}-V${C_RESET}, ${C_GREEN}--version${C_RESET} Show version information."
114111
echo -e " ${C_GREEN}-h${C_RESET}, ${C_GREEN}--help${C_RESET} Show this help message."
@@ -421,8 +418,6 @@ AUTO_PULL=false
421418
RELEASE_MODE=false
422419
RELEASE_ARG=""
423420
REMAP=false
424-
CLI_ROLLOVER=false
425-
426421
# Save original args before the while loop consumes them (needed for re-exec after upgrade)
427422
ORIGINAL_ARGS=("$@")
428423

@@ -433,7 +428,6 @@ while (( "$#" )); do
433428
--pull) AUTO_PULL=true ;;
434429
--changelog|-c) UPDATE_CHANGELOG=true ;;
435430
--remap) REMAP=true ;;
436-
--rollover) CLI_ROLLOVER=true ;;
437431
--provider|-p)
438432
shift
439433
if [[ -z "${1:-}" || "${1:-}" =~ ^- ]]; then
@@ -612,11 +606,9 @@ MODEL_URL="${MODEL_URL%/}"
612606
# ---------- Resolve version rollover (off by default) ----------
613607
# When enabled, version components that reach their max carry over into the
614608
# next more-significant component (like digits in a number system).
615-
# Precedence: CLI --rollover > AICOMMIT_ROLLOVER env > config file > off.
609+
# Precedence: AICOMMIT_ROLLOVER env > config file > off.
616610
ROLLOVER=false
617-
if [[ "$CLI_ROLLOVER" == "true" ]]; then
618-
ROLLOVER=true
619-
elif [[ -n "${AICOMMIT_ROLLOVER:-}" ]]; then
611+
if [[ -n "${AICOMMIT_ROLLOVER:-}" ]]; then
620612
[[ "${AICOMMIT_ROLLOVER,,}" == "true" || "$AICOMMIT_ROLLOVER" == "1" ]] && ROLLOVER=true
621613
elif [[ -f "$CONFIG_FILE" ]]; then
622614
cfg_rollover=$(grep -E '^AICOMMIT_ROLLOVER=' "$CONFIG_FILE" 2>/dev/null | head -1 | cut -d= -f2 | tr -d '[:space:]"'"'" || true)

tests/integration/test_rollover.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ setup() {
1515
ROLLOVER_MAX_PATCH=100
1616
}
1717

18-
@test "aicommit --rollover flag exists in help" {
18+
@test "aicommit help does not expose rollover as a flag" {
1919
run "$AICOMMIT_SCRIPT" --help
2020
[ "$status" -eq 0 ]
21-
[[ "$output" =~ "--rollover" ]]
21+
! [[ "$output" =~ "--rollover" ]]
2222
}
2323

2424
# ---------- rollover OFF (default): legacy behaviour ----------

0 commit comments

Comments
 (0)