Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Jul 30, 2024
1 parent d6ac8cd commit 5d39d7b
Show file tree
Hide file tree
Showing 4 changed files with 105,545 additions and 29 deletions.
47 changes: 18 additions & 29 deletions Source/Fn/Summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,62 +28,51 @@ pub async fn Fn(

let Tag: Vec<_> = Name.iter().filter_map(|Tag| Tag).collect();

let Count = Tag.len();

let Head = Repository.head()?;

let First = Repository.find_commit(First::Fn(&Repository)?)?.id().to_string();

let Last = Head.peel_to_commit()?.id().to_string();

match Count {
0 => {
println!("Summary from {} to {}:", First, Last);

println!(
"{}",
crate::Fn::Summary::Difference::Fn(&Repository, &First, &Last, Option,)?
);
}
1 => {
let Latest = Tag.get(0).unwrap();

println!("Summary from {} to {}:", First, Latest);
if Tag.is_empty() {
println!("🗣️ Summary from first commit: {} to last commit: {}:", First, Last);

println!(
"{}",
crate::Fn::Summary::Difference::Fn(&Repository, &First, Latest, Option,)?
);
println!(
"{}",
crate::Fn::Summary::Difference::Fn(&Repository, &First, &Last, Option,)?
);
} else {
for Window in Tag.windows(2) {
let Start = Window[0];
let End = Window[1];

println!("Summary from {} to {}:", Latest, Last);
println!("🗣️ Summary from tag: {} to tag: {}:", Start, End);

println!(
"{}",
crate::Fn::Summary::Difference::Fn(&Repository, Latest, &Last, Option,)?
crate::Fn::Summary::Difference::Fn(&Repository, Start, End, Option)?
);
}
_ => {
let Latest = Tag.get(Count - 1).unwrap();
let Previous = Tag.get(Count - 2).unwrap();

println!("Summary from {} to {}:", Previous, Latest);
if let Some(Latest) = Tag.last() {
println!("🗣️ Summary from first commit: {} to latest tag: {}:", First, Latest);

println!(
"{}",
crate::Fn::Summary::Difference::Fn(&Repository, Previous, Latest, Option,)?
crate::Fn::Summary::Difference::Fn(&Repository, &First, Latest, Option)?
);

println!("Summary from {} to {}:", Previous, Last);
println!("🗣️ Summary from latest tag: {} to last commit: {}:", Latest, Last);

println!(
"{}",
crate::Fn::Summary::Difference::Fn(&Repository, Previous, &Last, Option,)?
crate::Fn::Summary::Difference::Fn(&Repository, Latest, &Last, Option)?
);
}
}
}
Err(_Error) => {
println!("Failed to open repository: {}", _Error);
println!("Cannot Repository: {}", _Error);

return Err(_Error.into());
}
Expand Down
Loading

0 comments on commit 5d39d7b

Please sign in to comment.