From 6ecd14f04b818f7972c626ac5e535dd970da138c Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 21 Mar 2026 14:03:28 -0700 Subject: [PATCH] `build_author_map()`: remove unused `from` parameter Was always specified as an empty string, just remove the parameter and the logic for when it was anything else --- src/main.rs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7de94877..d454ac31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -308,7 +308,7 @@ fn commit_coauthors(commit: &Commit) -> Vec { coauthors } -/// Build up an [`AuthorMap`] of commits authored between `from` and `to`. +/// Build up an [`AuthorMap`] of commits authored up to and including `to`. /// /// This function is a wrapper around [`build_author_map_`] to add additional /// context to any errors; see that function for further documentation. @@ -316,16 +316,14 @@ fn build_author_map( repo: &Repository, reviewers: &Reviewers, mailmap: &Mailmap, - from: &str, to: &str, ) -> Result> { - match build_author_map_(repo, reviewers, mailmap, from, to) { + match build_author_map_(repo, reviewers, mailmap, to) { Ok(o) => Ok(o), Err(err) => Err(ErrorContext( format!( - "build_author_map(repo={}, from={:?}, to={:?})", + "build_author_map(repo={}, to={:?})", repo.path().display(), - from, to ), err, @@ -457,11 +455,7 @@ fn parse_bors_reviewer( Ok(Some(reviewers)) } -/// Build up an [`AuthorMap`] of commits authored between `from` and `to`. -/// -/// If `from` is empty, commits authored up to and including `to` are processed. -/// If `from` is non-empty, commits starting *after* `from` are processed, up -/// to and including the `to` commit. +/// Build up an [`AuthorMap`] of commits authored up to and including `to`. /// /// For each commit processed, authorship is added to the `AuthorMap` result /// according to the following rules: @@ -483,7 +477,6 @@ fn build_author_map_( repo: &Repository, reviewers: &Reviewers, mailmap: &Mailmap, - from: &str, to: &str, ) -> Result> { let mut walker = repo.revwalk()?; @@ -499,12 +492,8 @@ fn build_author_map_( ])?; } - if from == "" { - let to = repo.revparse_single(to)?.peel_to_commit()?.id(); - walker.push(to)?; - } else { - walker.push_range(&format!("{}..{}", from, to))?; - } + let to = repo.revparse_single(to)?.peel_to_commit()?.id(); + walker.push(to)?; let mut author_map = AuthorMap::new(); for oid in walker { @@ -579,7 +568,7 @@ fn up_to_release( })?; let modules = get_submodules(&repo, &to_commit)?; - let mut author_map = build_author_map(&repo, &reviewers, &mailmap, "", &to.raw_tag) + let mut author_map = build_author_map(&repo, &reviewers, &mailmap, &to.raw_tag) .map_err(|e| ErrorContext(format!("Up to {}", to), e))?; for module in &modules { @@ -589,7 +578,6 @@ fn up_to_release( &subrepo, &reviewers, &mailmap, - "", &module.commit.to_string(), )?; author_map.extend(submap); @@ -655,7 +643,7 @@ fn generate_thanks() -> Result, Box