Compare commits

..

1 commit

Author SHA1 Message Date
8e52486e87 WIP: feat(tui): highlight branchs in log
All checks were successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
2024-08-31 17:46:42 +01:00
2 changed files with 3 additions and 5 deletions

View file

@ -9,8 +9,8 @@ use crate::{
static OKAY: Color = Color::Green;
static PREP: Color = Color::Gray;
static ACTING: Color = Color::LightBlue;
static WARN: Color = Color::Red;
static ACTING: Color = Color::Yellow;
static WARN: Color = Color::LightYellow;
impl Handler<ServerUpdate> for Tui {
type Result = ();

View file

@ -53,7 +53,7 @@ lazy_static::lazy_static! {
static ref BRANCHES: Regex =
#[allow(clippy::unwrap_used)]
Regex::new(
r"origin\/(?<branch>[^,]+)",
r"origin\/(?<branch>.*?)[,$]",
).unwrap();
}
impl From<LogLine> for Line<'_> {
@ -62,7 +62,6 @@ impl From<LogLine> for Line<'_> {
let pre = caps["pre"].to_owned();
let hash = caps["hash"].to_owned();
let message = caps["message"].to_owned();
info!(branches=?caps["branches"], "raw branches");
let mut branches = BRANCHES
.captures_iter(&caps["branches"])
.map(|captures| captures["branch"].to_owned())
@ -79,7 +78,6 @@ impl From<LogLine> for Line<'_> {
} else {
// line withbranches
let mut spans = vec![pre.into(), " ".into(), hash.into(), " ".into()];
info!(?branches, "matched branch list");
branches.sort();
branches
.into_iter()