Skip to content

JJ insertion and deletion counts can match numeric text in filenames #693

Open

Description

@vishnujayvel

The JJ Insertions and Deletions widgets can read a number in a filename as the change total.

On ccstatusline main 3b602348afbbe082eb919b576b55926bbf8d19d6, the production getJjChangeCounts() parses the entire jj diff --stat output. Given this valid output shape:

777 insertions.txt | 1 +
1 file changed, 1 insertion(+), 0 deletions(-)

it returns {insertions: 777, deletions: 0} instead of {insertions: 1, deletions: 0}. A corresponding 888 deletions.txt row returns 888 deletions instead of 1.

Reproduced through the existing mocked execFileSync seam with the real imported production module under Bun 1.3.14. The two regression assertions fail on the original implementation; the existing singular/plural, empty-output and command-error controls pass. This is a production-parser reproduction, not a live JJ CLI run; JJ is not installed on the test host.

Jujutsu's formatter emits file rows before the summary (primary implementation). The neighboring JjChanges widget already reads only the final summary line. Restricting insertion/deletion parsing to that line avoids filename matches without changing command/cache behavior.

Current open-PR coverage and targeted issue searches found no matching repair. The overlapping #632 changes caching and leaves parseDiffStat unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions