Fix blank lines after index lines in Jujutsu diffs.
Review Request #15297 — Created Sept. 14, 2026 and updated — Latest diff uploaded
JujutsuClient rewrites the short blob hashes in
indexlines from
jj diff --gitinto full hashes. The regex for the rest of the line
used\s.*, which also matched the trailing newline. jj leaves the file
mode off index lines for added and deleted files, so for those files the
newline was captured and written back out, followed by another newline.
The result was a blank line after theindexline for every added or
deleted file.Review Board's diff parser didn't care, so this wasn't too big a
problem.The regex now only matches a space before the rest of the line. The
existing test for deleted files expected the blank line, so it has been
updated.
- Ran unit tests.
- Ran
rbt diff 'root()' @-and verified that no index lines are
followed by a blank line. Before this change, all 518 were. - Verified that modified files still keep the file mode on their index
lines.