ok/jj
1
0
Fork 0
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:
Jonathan Tan 2024-07-10 14:42:46 -07:00 committed by jonathantanmy
parent 10a272aea6
commit 579ba8031b
2 changed files with 4 additions and 4 deletions

View file

@ -514,7 +514,7 @@ impl<W: Write> Write for ColorFormatter<W> {
labels: &[String],
debug: bool,
) -> io::Result<()> {
if debug {
if debug && !labels.is_empty() {
write!(output, "<<{}::", labels.join(" "))?;
write_sanitized(output, buf)?;
write!(output, ">>")?;

View file

@ -490,9 +490,9 @@ fn test_color_ui_messages() {
// debugging colors
let (stdout, _stderr) = test_env.jj_cmd_ok(&repo_path, &["st", "--color", "debug"]);
insta::assert_snapshot!(stdout, @r###"
<<::The working copy is clean>>
<<::Working copy : >><<working_copy change_id shortest prefix::m>><<working_copy change_id shortest rest::zvwutvl>><<working_copy:: >><<working_copy commit_id shortest prefix::1>><<working_copy commit_id shortest rest::67f90e7>><<working_copy:: >><<working_copy empty::(empty)>><<working_copy:: >><<working_copy empty description placeholder::(no description set)>><<::>>
<<::Parent commit: >><<change_id shortest prefix::q>><<change_id shortest rest::pvuntsm>><<:: >><<commit_id shortest prefix::2>><<commit_id shortest rest::30dd059>><<:: >><<empty::(empty)>><<:: >><<empty description placeholder::(no description set)>><<::>>
The working copy is clean
Working copy : <<working_copy change_id shortest prefix::m>><<working_copy change_id shortest rest::zvwutvl>><<working_copy:: >><<working_copy commit_id shortest prefix::1>><<working_copy commit_id shortest rest::67f90e7>><<working_copy:: >><<working_copy empty::(empty)>><<working_copy:: >><<working_copy empty description placeholder::(no description set)>>
Parent commit: <<change_id shortest prefix::q>><<change_id shortest rest::pvuntsm>> <<commit_id shortest prefix::2>><<commit_id shortest rest::30dd059>> <<empty::(empty)>> <<empty description placeholder::(no description set)>>
"###);
}