chlog: cap the commit walk that builds an entry

The boundary search was capped at --limit, but the summaries the entry
is built from were not: with a version tag, the walk ran the whole
HEAD..tag range and listed every summary, which on kernel-sized
histories meant minutes of crawling and an entry with a bullet per
commit. The same cap now bounds how many summaries the entry
collects, warning when the range was truncated.

The boundary search itself also gets cheaper: whether a commit
touched the changelog is now a comparison of the path's tree entry
(blob id and mode) between the commit and its first parent, instead
of a tree diff per commit.
This commit is contained in:
vhaudiquet authored and Valentin Haudiquet committed 2026-11-24 20:58:34 +01:00
1 parent 674b99b00b
commit 03e42f8432
3 files changed
+104 -26

No files matched your search

+5 -3
View File
@@ -117,9 +117,11 @@ git push xxx user-fork
with `--file <path>` (`-f`).
`pkh chlog` walks the commit history back to the previous changelog entry.
Without a version tag, that search is capped at the last 500 commits
(`--limit <n>`, `0` = unlimited): beyond the cap, the entry simply starts
at the oldest commit searched, which keeps the run fast on large histories.
That walk, and the list of commits the entry is built from, are capped at
500 commits (`--limit <n>`, `0` = unlimited): a boundary far behind HEAD —
a stale version tag in a kernel-sized history — truncates the entry to the
newest 500 commits instead of crawling the whole range, which keeps the
run fast on large histories.
### Incremental builds (build records)