From 8e6035c1853eb9cf47eee6845bf84e7f8dbd8d36 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Fri, 9 Oct 2026 17:00:27 +0200 Subject: [PATCH] chlog: default the history cap to 50 An entry listing 500 commits is not a useful draft, and 50 keeps the default window small enough that even the first run on a kernel-sized tree stays instant. --limit still takes any value, 0 for unlimited. --- README.md | 4 ++-- src/main.rs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b315dde..dab7702 100644 --- a/README.md +++ b/README.md @@ -118,9 +118,9 @@ with `--file ` (`-f`). `pkh chlog` walks the commit history back to the previous changelog entry. That walk, and the list of commits the entry is built from, are capped at -500 commits (`--limit `, `0` = unlimited): a boundary far behind HEAD — +50 commits (`--limit `, `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 +newest 50 commits instead of crawling the whole range, which keeps the run fast on large histories. ### Incremental builds (build records) diff --git a/src/main.rs b/src/main.rs index fd1b6f7..3d7e602 100644 --- a/src/main.rs +++ b/src/main.rs @@ -367,7 +367,7 @@ fn main() { .arg(arg!(-v --version "Target version (overrides the --backport/--nmu/--rebuild numbering)").required(false)) .arg(arg!(-f --file "Path to the changelog file to generate into and edit (default: debian/changelog)").required(false).default_value("debian/changelog")) .arg(arg!(--limit "Cap how far back the history is searched for the previous changelog entry, and how many commits the entry lists (0 = unlimited)").required(false) - .value_parser(clap::value_parser!(usize)).default_value("500")), + .value_parser(clap::value_parser!(usize)).default_value("50")), ) .subcommand( Command::new("build") @@ -726,10 +726,7 @@ fn main() { info!("Done."); } Some(("chlog", sub_matches)) => { - let history_limit = sub_matches - .get_one::("limit") - .copied() - .unwrap_or(500); + let history_limit = sub_matches.get_one::("limit").copied().unwrap_or(50); let changelog_file = sub_matches .get_one::("file") .map(|s| s.to_string())