Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

fix(git): read the newest 5,000 commits by default instead of 500 (#3833)

Raghav Chamadiya1d42fe36104a
diff --git a/docs/layers/OWNERSHIP.md b/docs/layers/OWNERSHIP.md
index 67c080100..a263db1e5 100644
--- a/docs/layers/OWNERSHIP.md
+++ b/docs/layers/OWNERSHIP.md
@@ -148,7 +148,7 @@ The detectors use the code-health rules file, `.repowise/health-rules.json`:
- `severity_overrides` sets a detector's label; an explicit entry wins over the
profile.
- History depth: `repowise init --commit-limit N` sets how many commits per file
- are read (default 500, maximum 10000). `--follow-renames` follows a file
+ are read (default 5000, maximum 10000). `--follow-renames` follows a file
across renames, so ownership survives a move. Both are saved to config.
- `--mode fast` skips blame. Owners then come from commit counts alone and
`owner_line_pct` stays empty.
@@ -192,7 +192,7 @@ Full schema: [CONFIG.md](../reference/CONFIG.md#the-health-rulesjson-file).
| `repowise risk` | `--target PATH` | Score a file's history, including owners and bus factor |
| `repowise risk` | `--changed-file PATH` | With `--target`: PR mode; `--format json` includes `recommended_reviewers` |
| `repowise health` | `--file PATH` | One file's findings, including the ownership detectors |
-| `repowise init` | `--commit-limit N` | Commits read per file (default 500, max 10000) |
+| `repowise init` | `--commit-limit N` | Commits read per file (default 5000, max 10000) |
| `repowise init` | `--follow-renames` | Track files across renames |
| `repowise init` | `--mode fast` | Skip blame; commit-count ownership only |
diff --git a/docs/reference/CLI_REFERENCE.md b/docs/reference/CLI_REFERENCE.md
index d16ac3770..59a896ba7 100644
--- a/docs/reference/CLI_REFERENCE.md
+++ b/docs/reference/CLI_REFERENCE.md
@@ -176,7 +176,7 @@ All three reach the indexing knobs; the LLM-only knobs appear only when model-wr
| `--language` | Output language for generated wiki pages: `en` (default), `ar`, `de`, `es`, `fr`, `hi`, `it`, `ja`, `ko`, `nl`, `pl`, `pt`, `ru`, `tr`, `zh`. Code, file paths, and symbol names stay untranslated. Saved to config so `update` keeps the language. Also asked in advanced interactive mode. To switch an existing wiki's language, set the flag and re-run `init --force`. |
| `--resume` | Continue a previous run instead of redoing it: completed phases (indexing, analysis) are skipped, the earlier run's git tier is kept, and generation writes only the pages this repo does not have yet. Use it after an interrupted run, and after one that finished with failed pages (a provider outage, rate limiting) — pages already written are skipped with no model call, so nothing is paid for twice. Matching is per page, not per model, so switching provider still keeps what the old one wrote. |
| `--force` | Regenerate all pages even if they exist. Re-indexes this checkout from scratch in the mode you invoked, so inside a linked worktree it also skips seeding (a re-index is what seeding exists to avoid) and runs as a normal full init. Never triggers a model: `--force --no-prose` re-renders the whole wiki from templates at no cost. Use `repowise update --full` to regenerate with a model. |
-| `--commit-limit` | Max commits to analyze per file (default: 500, capped at 10000) |
+| `--commit-limit` | Max commits to analyze per file (default: 5000, capped at 10000) |
| `--follow-renames` | Track file renames in git history |
| `--no-claude-md` | Don't generate `CLAUDE.md` |
| `--agents` / `--no-agents` | Generate or skip managed `AGENTS.md` for Codex. Persists the preference. |
diff --git a/docs/reference/CONFIG.md b/docs/reference/CONFIG.md
index 165ab5483..ed37560e1 100644
--- a/docs/reference/CONFIG.md
+++ b/docs/reference/CONFIG.md
@@ -108,7 +108,7 @@ embedder: mock # Embedding provider (mock if no key detect
embedding_model: text-embedding-3-small # Embedding model (provider default if omitted)
reasoning: auto # auto | off | none | minimal | low | medium | high | xhigh | max
max_tokens: 16384 # Max output tokens for each generated documentation page
-commit_limit: 500 # Max commits per file for git analysis (clamped 1-10000)
+commit_limit: 5000 # Max commits per file for git analysis (clamped 1-10000)
follow_renames: false # Track file renames in git history
wiki_style: comprehensive # comprehensive | caveman | reference | tutorial | custom
language: en # Output language for generated pages (en, zh, ru, hi, ...)
@@ -150,7 +150,7 @@ You can edit this file directly. Changes take effect on the next `init`,
| `embedding_model` | provider default | Embedding model identifier |
| `reasoning` | `auto` | `auto`, `off`, `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
| `max_tokens` | `16384` | Maximum output tokens requested for each model-written documentation page |
-| `commit_limit` | `500` | Max commits per file walked for git analysis, clamped to 1-10000 |
+| `commit_limit` | `5000` | Newest commits walked for git analysis and stored as commit rows, clamped to 1-10000 |
| `follow_renames` | `false` | Track file renames through git history |
| `exclude_patterns` | `[]` | Extra gitignore-style patterns, on top of `.gitignore` |
| `wiki_style` | `comprehensive` | `comprehensive`, `caveman`, `reference`, `tutorial`, `custom` |
@@ -163,6 +163,12 @@ You can edit this file directly. Changes take effect on the next `init`,
| `refactoring` | see below | Refactoring-intelligence config |
| `forges.hosts` | `{}` | Maps a self-managed git host to its forge (`github`, `gitlab`, `azure`, `bitbucket`, `generic`). See [GIT_HOSTS.md](../start/GIT_HOSTS.md#self-managed-hosts) |
+`commit_limit` sets how far back history-based signals see: churn, co-change,
+the commit list and change records. The first `repowise update` after upgrading
+re-reads the history once, with no model calls. A `commit_limit` written in
+`config.yaml` is kept as set, and when it is below the default `repowise update`
+says so once.
+
`reasoning` controls documentation-generation calls for reasoning-capable chat
models. `auto` preserves provider defaults. `off`/`none` disable Qwen3-style
thinking for OpenAI-compatible vLLM/SGLang endpoints (sends
diff --git a/packages/cli/src/repowise/cli/commands/init_cmd/command.py b/packages/cli/src/repowise/cli/commands/init_cmd/command.py
index 4a3f297c7..c0ed63514 100644
--- a/packages/cli/src/repowise/cli/commands/init_cmd/command.py
+++ b/packages/cli/src/repowise/cli/commands/init_cmd/command.py
@@ -622,7 +622,7 @@ def _interactive_gate(
"--commit-limit",
type=int,
default=None,
- help="Max commits to analyze per file and for co-change detection (default: 500, max: 10000). Saved to config.",
+ help="Max commits to analyze per file and for co-change detection (default: 5000, max: 10000). Saved to config.",
)
@click.option(
"--follow-renames",
@@ -1286,8 +1286,12 @@ def init_command(
resolved_reasoning = resolve_reasoning(reasoning, config)
exclude_patterns: list[str] = list(config.get("exclude_patterns") or []) + list(exclude)
- # Resolve commit limit: CLI flag → config.yaml → default (500)
- resolved_commit_limit: int = commit_limit or config.get("commit_limit") or 500
+ # Resolve commit limit: CLI flag → config.yaml → default
+ from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
+
+ resolved_commit_limit: int = (
+ commit_limit or config.get("commit_limit") or _DEFAULT_COMMIT_LIMIT
+ )
resolved_commit_limit = max(1, min(resolved_commit_limit, 10000))
if commit_limit is not None:
config["commit_limit"] = resolved_commit_limit
diff --git a/packages/cli/src/repowise/cli/commands/init_cmd/workspace.py b/packages/cli/src/repowise/cli/commands/init_cmd/workspace.py
index cbb0719f0..8ef614e3e 100644
--- a/packages/cli/src/repowise/cli/commands/init_cmd/workspace.py
+++ b/packages/cli/src/repowise/cli/commands/init_cmd/workspace.py
@@ -894,7 +894,9 @@ def _workspace_init(
console.print()
# Step 4: Index each selected repo (always generate_docs=False; generation is separate)
- resolved_commit_limit = max(1, min(commit_limit or 500, 10000))
+ from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
+
+ resolved_commit_limit = max(1, min(commit_limit or _DEFAULT_COMMIT_LIMIT, 10000))
total_files = 0
total_symbols = 0
total_pages = 0
diff --git a/packages/cli/src/repowise/cli/commands/update_cmd/command.py b/packages/cli/src/repowise/cli/commands/update_cmd/command.py
index 5fa6a5c98..ad82188e6 100644
--- a/packages/cli/src/repowise/cli/commands/update_cmd/command.py
+++ b/packages/cli/src/repowise/cli/commands/update_cmd/command.py
@@ -1244,9 +1244,11 @@ def run_update(
# where an orientation page registered after the index was built is
# most likely to go unmentioned forever: it returns before the
# generation code, so nothing else in the run can notice.
+ from .commit_limit_notice import surface_pinned_commit_limit
from .slot_notice import surface_missing_slots
surface_missing_slots(repo_path, emitter=emitter, dry_run=dry_run)
+ surface_pinned_commit_limit(repo_path, emitter=emitter, dry_run=dry_run)
if emitter is not None:
emitter.done(
ok=True,
@@ -1372,9 +1374,11 @@ def run_update(
# An orientation page registered after this index was built cannot arrive
# below, because this run's parsed_files is the changed-file slice, so name
# the command that does reach it. Says nothing when there is nothing to say.
+ from .commit_limit_notice import surface_pinned_commit_limit
from .slot_notice import surface_missing_slots
surface_missing_slots(repo_path, emitter=emitter, dry_run=dry_run)
+ surface_pinned_commit_limit(repo_path, emitter=emitter, dry_run=dry_run)
render_header(repo_path, base_ref, head)
diff --git a/packages/cli/src/repowise/cli/commands/update_cmd/commit_limit_notice.py b/packages/cli/src/repowise/cli/commands/update_cmd/commit_limit_notice.py
new file mode 100644
index 000000000..7a3cb90cf
--- /dev/null
+++ b/packages/cli/src/repowise/cli/commands/update_cmd/commit_limit_notice.py
@@ -0,0 +1,60 @@
+"""Telling a user that their config pins a history window below the default.
+
+``commit_limit`` written in ``config.yaml`` is the user's choice and is never
+changed for them. When it sits below the default window, say so once per store
+and per pinned value, so a raised default does not pass a pinned repo by
+unnoticed. Shares the shown-notice ledger with the other one-shot notices.
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Any
+
+import structlog
+
+from repowise.cli.helpers import console, load_config, load_state
+from repowise.cli.upgrade import SHOWN_NOTICES_KEY
+
+log = structlog.get_logger(__name__)
+
+_LEDGER_PREFIX = "commit_limit_pinned:"
+
+
+def surface_pinned_commit_limit(repo_path: Path, *, emitter: Any, dry_run: bool) -> None:
+ """Print one dim line, once, when ``commit_limit`` is pinned below the default.
+
+ Interactive-terminal only, like the other one-shot notices, so a background
+ post-commit update never spends it on a log nobody reads.
+ """
+ from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
+
+ if not (console.is_terminal and emitter is None):
+ return
+ try:
+ pinned = int(load_config(repo_path).get("commit_limit") or 0)
+ except (TypeError, ValueError):
+ return
+ if not 0 < pinned < _DEFAULT_COMMIT_LIMIT:
+ return
+ key = f"{_LEDGER_PREFIX}{pinned}:{_DEFAULT_COMMIT_LIMIT}"
+ state = load_state(repo_path)
+ shown = state.get(SHOWN_NOTICES_KEY)
+ if isinstance(shown, list) and key in shown:
+ return
+
+ console.print(
+ f"[dim]commit_limit is pinned to {pinned} in config.yaml; "
+ f"the default is now {_DEFAULT_COMMIT_LIMIT}.[/dim]"
+ )
+ if dry_run:
+ return
+ try:
+ from repowise.cli.helpers import save_state
+
+ shown = list(shown) if isinstance(shown, list) else []
+ shown.append(key)
+ state[SHOWN_NOTICES_KEY] = shown
+ save_state(repo_path, state)
+ except Exception as exc: # a ledger write must never break a command
+ log.debug("commit_limit_notice.record_failed", error=str(exc))
diff --git a/packages/cli/src/repowise/cli/commands/upgrade_flow.py b/packages/cli/src/repowise/cli/commands/upgrade_flow.py
index c15a5d7dc..dcf0e9412 100644
--- a/packages/cli/src/repowise/cli/commands/upgrade_flow.py
+++ b/packages/cli/src/repowise/cli/commands/upgrade_flow.py
@@ -48,6 +48,7 @@ from repowise.core.analysis.health import HEALTH_ANALYZER_VERSION
from repowise.core.docs_mode import docs_mode_state_fields
from repowise.core.index_scope import file_page_scope, stamp_index_scope
from repowise.core.ingestion.git_indexer import GIT_HISTORY_VERSION, GIT_HISTORY_VERSION_KEY
+from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
from repowise.core.update_lock import release_update_lock, try_acquire_update_lock
@@ -843,7 +844,9 @@ def upgrade_to_full(
run_mode="standard",
content_provenance="model",
git_tier="full",
- git_commit_cap=commit_limit if isinstance(commit_limit, int) else 500,
+ git_commit_cap=(
+ commit_limit if isinstance(commit_limit, int) else _DEFAULT_COMMIT_LIMIT
+ ),
git_history_coverage=outcome["git_history_coverage"],
file_pages=outcome["file_pages"],
analysis={"unavailable": [], "skipped": []},
diff --git a/packages/cli/src/repowise/cli/commands/workspace_cmd.py b/packages/cli/src/repowise/cli/commands/workspace_cmd.py
index 336ff258a..f42b1134b 100644
--- a/packages/cli/src/repowise/cli/commands/workspace_cmd.py
+++ b/packages/cli/src/repowise/cli/commands/workspace_cmd.py
@@ -583,7 +583,7 @@ def _run_index_for_repo(
effective_model = model or primary_cfg.get("model")
embedder_name = primary_cfg.get("embedder", "mock")
exclude_patterns = list(primary_cfg.get("exclude_patterns") or [])
- commit_limit = primary_cfg.get("commit_limit", 500)
+ commit_limit = primary_cfg.get("commit_limit")
# Resolve the provider once. If docs were requested but provider
# resolution fails, fall back to index-only with a loud notice instead
@@ -612,11 +612,12 @@ def _run_index_for_repo(
# Shared full-index step (run pipeline, persist, export the curated KG
# artifact so doc generation can load curated module grouping) — the
# same helper the workspace updater's first-time indexing uses.
+ from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
from repowise.core.pipeline.full_index import index_repo_full
result = await index_repo_full(
repo_path,
- commit_depth=int(commit_limit) if commit_limit else 500,
+ commit_depth=int(commit_limit) if commit_limit else _DEFAULT_COMMIT_LIMIT,
exclude_patterns=exclude_patterns,
)
return result.file_count, result.symbol_count, 0
diff --git a/packages/cli/src/repowise/cli/ui/mode_selection.py b/packages/cli/src/repowise/cli/ui/mode_selection.py
index 045ad9879..c9eace500 100644
--- a/packages/cli/src/repowise/cli/ui/mode_selection.py
+++ b/packages/cli/src/repowise/cli/ui/mode_selection.py
@@ -383,17 +383,12 @@ def _prompt_git(console: Console, scan: RepoScanInfo | None, result: dict[str, A
print_section(console, "Git analysis", f"Controls how deeply git history is analyzed{commit_hint}")
console.print()
- # Smart default based on repo size
- default_limit = 500
- if scan:
- if scan.total_files < 500:
- default_limit = 1000
- elif scan.total_files > 5000:
- default_limit = 200
+ # Imported here: this module must not load core.ingestion at import time.
+ from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
val = click.prompt(
" Max commits per file",
- default=default_limit,
+ default=_DEFAULT_COMMIT_LIMIT,
type=int,
)
val = max(1, min(val, 10000))
diff --git a/packages/core/src/repowise/core/ingestion/git_indexer/_constants.py b/packages/core/src/repowise/core/ingestion/git_indexer/_constants.py
index c6585e0e4..65009ec83 100644
--- a/packages/core/src/repowise/core/ingestion/git_indexer/_constants.py
+++ b/packages/core/src/repowise/core/ingestion/git_indexer/_constants.py
@@ -47,8 +47,9 @@ _DECISION_SIGNAL_WORDS: frozenset[str] = frozenset(
_MIN_MESSAGE_LEN = 12
-# Default per-file commit history depth.
-_DEFAULT_COMMIT_LIMIT: int = 500
+# Default history window: the newest commits walked for per-file history and
+# stored as commit rows. Every default ``commit_limit`` reads this one value.
+_DEFAULT_COMMIT_LIMIT: int = 5000
# Depth of the second, deeper repo-wide log walk that serves files absent
# from the recent-window commit index. On repos whose history is much
@@ -324,7 +325,8 @@ HOTSPOT_HALFLIFE_DAYS: float = 180.0
#: forge bot accounts).
#: v2: co-change records carry focused_frequency, the shared commits no wider
#: than the change-entropy sweep cap.
-#: v3: commits carry their category, and changes are rebuilt from history.
+#: v3: commits carry their category, and changes are rebuilt from history; the
+#: default history window grew from 500 to 5,000 commits.
GIT_HISTORY_VERSION: int = 3
GIT_HISTORY_VERSION_KEY = "git_history_version"
#: Stored under :data:`GIT_HISTORY_VERSION_KEY` by ``repowise attribution
diff --git a/packages/core/src/repowise/core/pipeline/full_index.py b/packages/core/src/repowise/core/pipeline/full_index.py
index f9bf08d3b..d0091df84 100644
--- a/packages/core/src/repowise/core/pipeline/full_index.py
+++ b/packages/core/src/repowise/core/pipeline/full_index.py
@@ -12,11 +12,13 @@ from __future__ import annotations
from pathlib import Path
from typing import Any
+from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
+
async def index_repo_full(
repo_path: Path,
*,
- commit_depth: int = 500,
+ commit_depth: int = _DEFAULT_COMMIT_LIMIT,
exclude_patterns: list[str] | None = None,
include_submodules: bool = False,
include_nested_repos: bool = False,
diff --git a/packages/core/src/repowise/core/pipeline/orchestrator.py b/packages/core/src/repowise/core/pipeline/orchestrator.py
index 5a7dcce92..6604be739 100644
--- a/packages/core/src/repowise/core/pipeline/orchestrator.py
+++ b/packages/core/src/repowise/core/pipeline/orchestrator.py
@@ -23,6 +23,7 @@ from typing import Any
import structlog
+from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
from repowise.core.pipeline.modes import OrchestratorMode
from repowise.core.pipeline.progress import (
STAGE_ANALYSIS,
@@ -190,7 +191,7 @@ class PipelineResult:
async def run_pipeline(
repo_path: Path | str,
*,
- commit_depth: int = 500,
+ commit_depth: int = _DEFAULT_COMMIT_LIMIT,
follow_renames: bool = False,
skip_tests: bool = False,
skip_infra: bool = False,
@@ -223,7 +224,7 @@ async def run_pipeline(
repo_path:
Path to an already-cloned repository on disk.
commit_depth:
- Maximum commits to analyse per file (1-10000). Default 500.
+ Maximum commits to analyse per file (1-10000). Default 5000.
follow_renames:
Use ``git log --follow`` to track files across renames.
skip_tests:
diff --git a/packages/core/src/repowise/core/workspace/cross_repo.py b/packages/core/src/repowise/core/workspace/cross_repo.py
index af94a344c..1e0c3314c 100644
--- a/packages/core/src/repowise/core/workspace/cross_repo.py
+++ b/packages/core/src/repowise/core/workspace/cross_repo.py
@@ -47,7 +47,7 @@ CROSS_REPO_EDGES_FILENAME = "cross_repo_edges.json"
_OVERLAY_VERSION: int = 2
_DEFAULT_TIME_WINDOW_HOURS: int = 24
-_DEFAULT_COMMIT_LIMIT: int = 500
+_CROSS_REPO_COMMIT_LIMIT: int = 500
# Strength is a bounded [0, 1) share (see detect_cross_repo_co_changes), so
# the floor is a ratio: pairs that co-occur in under ~20% of the less-active
# file's sessions are coincidence, not coupling.
@@ -257,7 +257,7 @@ class _GitCommit:
def _parse_git_log(
repo_path: Path,
- commit_limit: int = _DEFAULT_COMMIT_LIMIT,
+ commit_limit: int = _CROSS_REPO_COMMIT_LIMIT,
) -> list[_GitCommit]:
"""Run ``git log`` and parse into structured commit records.
@@ -401,7 +401,7 @@ def detect_cross_repo_co_changes(
repo_paths: dict[str, Path],
*,
time_window_hours: int = _DEFAULT_TIME_WINDOW_HOURS,
- commit_limit: int = _DEFAULT_COMMIT_LIMIT,
+ commit_limit: int = _CROSS_REPO_COMMIT_LIMIT,
min_score: float = _MIN_CROSS_REPO_SCORE,
min_sessions: int = _MIN_CO_SESSIONS,
) -> tuple[list[CrossRepoCoChange], int]:
diff --git a/packages/core/src/repowise/core/workspace/update.py b/packages/core/src/repowise/core/workspace/update.py
index b881836de..994939158 100644
--- a/packages/core/src/repowise/core/workspace/update.py
+++ b/packages/core/src/repowise/core/workspace/update.py
@@ -51,6 +51,7 @@ from ..ingestion.git_indexer import (
GIT_HISTORY_VERSION_KEY,
git_history_stale,
)
+from ..ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
from ..pipeline.phase_timing import PhaseTimingRecorder
from .config import WorkspaceConfig
@@ -742,7 +743,7 @@ async def _has_persisted_repo_index(repo_path: Path) -> bool:
async def update_single_repo_index(
repo_path: Path,
*,
- commit_depth: int = 500,
+ commit_depth: int = _DEFAULT_COMMIT_LIMIT,
exclude_patterns: list[str] | None = None,
include_working_tree: bool = False,
progress: Any | None = None,
@@ -895,7 +896,7 @@ async def update_workspace(
only_aliases: set[str] | None = None,
run_hooks: bool = True,
dry_run: bool = False,
- commit_depth: int = 500,
+ commit_depth: int = _DEFAULT_COMMIT_LIMIT,
exclude_patterns: list[str] | None = None,
include_working_tree: bool = False,
on_repo_start: Callable[[str], None] | None = None,
diff --git a/tests/unit/cli/test_ui_package.py b/tests/unit/cli/test_ui_package.py
index 14e946c68..e5a73fe02 100644
--- a/tests/unit/cli/test_ui_package.py
+++ b/tests/unit/cli/test_ui_package.py
@@ -112,7 +112,7 @@ def test_advanced_config_default_keys_no_fast(monkeypatch: pytest.MonkeyPatch) -
"include_submodules": False,
"run_mode": "standard",
"exclude": (),
- "commit_limit": 500,
+ "commit_limit": 5000,
"follow_renames": False,
# No scan, so the repo cannot be shown to be large: no cap, no question.
"max_file_pages": None,
@@ -143,7 +143,7 @@ def test_advanced_config_index_only_omits_generation_keys(
"include_submodules": False,
"run_mode": "standard",
"exclude": (),
- "commit_limit": 500,
+ "commit_limit": 5000,
"follow_renames": False,
# Asked in this branch too: an index-only run renders file pages as well.
"max_file_pages": None,
@@ -159,7 +159,7 @@ def test_advanced_config_allow_fast_small_repo(monkeypatch: pytest.MonkeyPatch)
result = _drive_advanced_config(monkeypatch, scan=scan, allow_fast=True)
# Small repo: run mode defaults to standard.
assert result["run_mode"] == "standard"
- assert result["commit_limit"] == 1000 # <500 files -> deeper history default
+ assert result["commit_limit"] == 5000 # the default window, whatever the repo size
assert result["concurrency"] == 12 # <200 files -> higher concurrency default
diff --git a/tests/unit/cli/test_update_commit_limit_notice.py b/tests/unit/cli/test_update_commit_limit_notice.py
new file mode 100644
index 000000000..2588fe8dc
--- /dev/null
+++ b/tests/unit/cli/test_update_commit_limit_notice.py
@@ -0,0 +1,66 @@
+"""The one-shot notice for a ``commit_limit`` pinned below the default window."""
+
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+
+from repowise.cli.commands.update_cmd import commit_limit_notice
+from repowise.cli.helpers import load_config, save_config_partial, save_state
+from repowise.core.ingestion.git_indexer._constants import _DEFAULT_COMMIT_LIMIT
+
+
+class _FakeTerminal:
+ is_terminal = True
+
+ def __init__(self) -> None:
+ self.lines: list[str] = []
+
+ def print(self, *args, **_kwargs) -> None:
+ self.lines.append(" ".join(str(a) for a in args))
+
+
+def console(monkeypatch) -> _FakeTerminal:
+ fake = _FakeTerminal()
+ monkeypatch.setattr(commit_limit_notice, "console", fake)
+ return fake
+
+
+def _repo(tmp_path: Path, limit: int | None) -> Path:
+ save_state(tmp_path, {})
+ if limit is not None:
+ save_config_partial(tmp_path, commit_limit=limit)
+ return tmp_path
+
+
+def _surface(repo: Path, *, dry_run: bool = False) -> None:
+ commit_limit_notice.surface_pinned_commit_limit(repo, emitter=None, dry_run=dry_run)
+
+
+def test_a_pinned_lower_limit_is_named_once(tmp_path: Path, console: _FakeTerminal) -> None:
+ repo = _repo(tmp_path, 500)
+ _surface(repo)
+ _surface(repo)
+ assert console.lines == [
+ f"[dim]commit_limit is pinned to 500 in config.yaml; "
+ f"the default is now {_DEFAULT_COMMIT_LIMIT}.[/dim]"
+ ]
+ # The user's choice is never changed for them.
+ assert load_config(repo)["commit_limit"] == 500
+
+
[email protected]("limit", [None, _DEFAULT_COMMIT_LIMIT, _DEFAULT_COMMIT_LIMIT + 1])
+def test_silent_without_a_lower_pin(
+ tmp_path: Path, console: _FakeTerminal, limit: int | None
+) -> None:
+ _surface(_repo(tmp_path, limit))
+ assert console.lines == []
+
+
+def test_a_dry_run_does_not_spend_the_notice(tmp_path: Path, console: _FakeTerminal) -> None:
+ repo = _repo(tmp_path, 200)
+ _surface(repo, dry_run=True)
+ _surface(repo)
+ assert len(console.lines) == 2
diff --git a/website/cli-reference.md b/website/cli-reference.md
index 24633e1ee..b3509169b 100644
--- a/website/cli-reference.md
+++ b/website/cli-reference.md
@@ -59,7 +59,7 @@ repowise init [PATH] [OPTIONS]
| `--reasoning` | choice | auto | Reasoning mode for supported providers: `auto`, `off`/`none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` |
| `--resume` | flag | false | Resume from last checkpoint after an interruption |
| `--force` | flag | false | Regenerate all pages even if up to date |
-| `--commit-limit` | int | 500 | Max commits per file for git analysis (max 5000, saved to config) |
+| `--commit-limit` | int | 5000 | Max commits per file for git analysis (max 10000, saved to config) |
| `--follow-renames` | flag | false | Track file renames in git history (saved to config) |
| `--no-claude-md` | flag | false | Skip generating `.claude/CLAUDE.md` |
| `--agents` / `--no-agents` | flag | config | Generate or skip managed `AGENTS.md` for Codex |
@@ -849,7 +849,7 @@ max_tokens: 16384
exclude_patterns:
- vendor/
- "*.generated.*"
-commit_limit: 500
+commit_limit: 5000
follow_renames: false
```
diff --git a/website/configuration.md b/website/configuration.md
index ce353a994..8e5e601f1 100644
--- a/website/configuration.md
+++ b/website/configuration.md
@@ -52,7 +52,7 @@ exclude_patterns: # Gitignore-style patterns
- vendor/
- "*.generated.*"
- proto/
-commit_limit: 500 # Max commits per file for git analysis
+commit_limit: 5000 # Max commits per file for git analysis
follow_renames: false # Track file renames in git history
editor_files:
claude_md: true