forked from mirrors/jj
--color=debug: print unlabeled text without markup
This makes the debug output cleaner and makes the subsequent commit easier to write.
This commit is contained in:
parent
10a272aea6
commit
579ba8031b
2 changed files with 4 additions and 4 deletions
|
@ -514,7 +514,7 @@ impl<W: Write> Write for ColorFormatter<W> {
|
||||||
labels: &[String],
|
labels: &[String],
|
||||||
debug: bool,
|
debug: bool,
|
||||||
) -> io::Result<()> {
|
) -> io::Result<()> {
|
||||||
if debug {
|
if debug && !labels.is_empty() {
|
||||||
write!(output, "<<{}::", labels.join(" "))?;
|
write!(output, "<<{}::", labels.join(" "))?;
|
||||||
write_sanitized(output, buf)?;
|
write_sanitized(output, buf)?;
|
||||||
write!(output, ">>")?;
|
write!(output, ">>")?;
|
||||||
|
|
|
@ -490,9 +490,9 @@ fn test_color_ui_messages() {
|
||||||
// debugging colors
|
// debugging colors
|
||||||
let (stdout, _stderr) = test_env.jj_cmd_ok(&repo_path, &["st", "--color", "debug"]);
|
let (stdout, _stderr) = test_env.jj_cmd_ok(&repo_path, &["st", "--color", "debug"]);
|
||||||
insta::assert_snapshot!(stdout, @r###"
|
insta::assert_snapshot!(stdout, @r###"
|
||||||
<<::The working copy is clean>>
|
The working copy is clean
|
||||||
<<::Working copy : >>[1m[38;5;13m<<working_copy change_id shortest prefix::m>>[38;5;8m<<working_copy change_id shortest rest::zvwutvl>>[39m<<working_copy:: >>[38;5;12m<<working_copy commit_id shortest prefix::1>>[38;5;8m<<working_copy commit_id shortest rest::67f90e7>>[39m<<working_copy:: >>[38;5;10m<<working_copy empty::(empty)>>[39m<<working_copy:: >>[38;5;10m<<working_copy empty description placeholder::(no description set)>>[0m<<::>>
|
Working copy : [1m[38;5;13m<<working_copy change_id shortest prefix::m>>[38;5;8m<<working_copy change_id shortest rest::zvwutvl>>[39m<<working_copy:: >>[38;5;12m<<working_copy commit_id shortest prefix::1>>[38;5;8m<<working_copy commit_id shortest rest::67f90e7>>[39m<<working_copy:: >>[38;5;10m<<working_copy empty::(empty)>>[39m<<working_copy:: >>[38;5;10m<<working_copy empty description placeholder::(no description set)>>[0m
|
||||||
<<::Parent commit: >>[1m[38;5;5m<<change_id shortest prefix::q>>[0m[38;5;8m<<change_id shortest rest::pvuntsm>>[39m<<:: >>[1m[38;5;4m<<commit_id shortest prefix::2>>[0m[38;5;8m<<commit_id shortest rest::30dd059>>[39m<<:: >>[38;5;2m<<empty::(empty)>>[39m<<:: >>[38;5;2m<<empty description placeholder::(no description set)>>[39m<<::>>
|
Parent commit: [1m[38;5;5m<<change_id shortest prefix::q>>[0m[38;5;8m<<change_id shortest rest::pvuntsm>>[39m [1m[38;5;4m<<commit_id shortest prefix::2>>[0m[38;5;8m<<commit_id shortest rest::30dd059>>[39m [38;5;2m<<empty::(empty)>>[39m [38;5;2m<<empty description placeholder::(no description set)>>[39m
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue