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
|
# 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 ""
|
$ 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
|
# filter by one or multiple authors
|
||||||
# without an -a flag all authors will be checked
|
# without an -a flag all authors will be checked
|
||||||
$ git-heatmap -a "username" -a "other"
|
$ git-heatmap -a "username" -a "other"
|
||||||
|
|
|
@ -28,6 +28,9 @@ pub struct CliArgs {
|
||||||
|
|
||||||
#[arg(long("until"))]
|
#[arg(long("until"))]
|
||||||
pub until: Option<String>,
|
pub until: Option<String>,
|
||||||
|
|
||||||
|
#[arg(long("no-merges"), default_value_t = false)]
|
||||||
|
pub no_merges: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_since_date() -> String {
|
fn get_since_date() -> String {
|
||||||
|
|
|
@ -193,6 +193,13 @@ fn get_commits(args: CliArgs, start_date: NaiveDate) -> Result<(usize, Vec<Commi
|
||||||
.ok()?
|
.ok()?
|
||||||
.to_string();
|
.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 author = c.author().ok()?;
|
||||||
|
|
||||||
let email = author.email.to_string();
|
let email = author.email.to_string();
|
||||||
|
|
Loading…
Reference in New Issue