Added a --no-merges flag so merges can be ignored
parent
31052bcd37
commit
cbb5d07cb4
|
@ -42,6 +42,9 @@ $ git-heatmap -r "/path/to/repo" -b "main" -r "/other/repo" -b "test"
|
|||
# or to comply with the same number of branch lists per repo lists rule from above
|
||||
$ git-heatmap -r "/path/to/repo" -b "main" -r "other/repo" -b ""
|
||||
|
||||
# by default merges are counted so using --no-merges ensures they won't be counted
|
||||
$ git-heatmap --no-merges
|
||||
|
||||
# filter by one or multiple authors
|
||||
# without an -a flag all authors will be checked
|
||||
$ git-heatmap -a "username" -a "other"
|
||||
|
|
|
@ -28,6 +28,9 @@ pub struct CliArgs {
|
|||
|
||||
#[arg(long("until"))]
|
||||
pub until: Option<String>,
|
||||
|
||||
#[arg(long("no-merges"), default_value_t = false)]
|
||||
pub no_merges: bool,
|
||||
}
|
||||
|
||||
fn get_since_date() -> String {
|
||||
|
|
|
@ -193,6 +193,13 @@ fn get_commits(args: CliArgs, start_date: NaiveDate) -> Result<(usize, Vec<Commi
|
|||
.ok()?
|
||||
.to_string();
|
||||
|
||||
if args.no_merges {
|
||||
let is_merge = c.parent_ids().count() > 1;
|
||||
if is_merge {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
let author = c.author().ok()?;
|
||||
|
||||
let email = author.email.to_string();
|
||||
|
|
Loading…
Reference in New Issue