Skip to content

Commit

Permalink
shorten output by common substring
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDavison committed Feb 26, 2024
1 parent 3f29a3c commit 515bd1e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "repoutil"
version = "0.26.0"
version = "0.27.0"
authors = ["Chris Davison <c.jr.davison@gmail.com>"]
edition = "2018"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub fn branchstat(p: &Path, as_json: bool) -> Result<Option<String>> {
)
} else {
format!(
"{:40} | {}",
"{:50} | {}",
p.display(),
outputs
)
Expand Down
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ fn main() {
.join(",")
);
} else {
let pathstrs: Vec<String> = all_repos.iter().map(|x| x.clone().display().to_string()).collect();
let common = common_substring(&pathstrs);
let messages = messages
.map(|x| x.to_string())
.collect::<Vec<String>>();
let common = common_substring(&messages);
dbg!(&common);
for msg in messages {
println!("{}", msg.replace(&common, ""))
}
Expand Down

0 comments on commit 515bd1e

Please sign in to comment.