• 
      

    Fix blank lines after index lines in Jujutsu diffs.

    Review Request #15297 — Created Sept. 14, 2026 and updated

    Information

    RBTools
    master

    Reviewers

    JujutsuClient rewrites the short blob hashes in index lines from
    jj diff --git into 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 the index line 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.
    Summary ID
    Fix blank lines after index lines in Jujutsu diffs.
    JujutsuClient rewrites the short blob hashes in `index` lines from `jj diff --git` into 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 the `index` line for every added or deleted file. 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. Testing Done: - 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.
    vopuxqrprnsskpttotsppyzuypqutsyy
    Checks run (2 succeeded)
    flake8 passed.
    JSHint passed.
    maubin
    1. Ship It!
    2.