You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Work diff canvas drops blank context lines when the user's Git config sets diff.suppressBlankEmpty #285
With diff.suppressBlankEmpty=true in the user's Git config, git diff writes a blank context line as an empty line instead of a single space. Git apply and GNU patch read that empty line as context. parse_unified_diff (server/unified_diff.py) drops it, so the Work attempt diff canvas loses every blank context line, and every following line in the hunk shows an old/new line number that is one too low per dropped line.
Expected: a blank context line is shown with its line numbers, and the rest of the hunk keeps the right numbers.
Run an attempt that changes b to B, then open the attempt diff.
The attempt patch is
@@ -1,4 +1,4 @@
a
-b
+B
c
Actual: lines a (1/1), -b (old 2), +B (new 2), c (3/3). The blank line is missing.
Expected: a (1/1), blank (2/2), -b (old 3), +B (new 3), c (4/4).
Relevant environment / 使用环境
Platform-independent; current main (f86c72a). Reproduced with Git 2.43 and 2.54. There is no git diff command-line option that overrides this setting.
Sanitized evidence / 错误信息或截图(请先脱敏)
The parser skips every empty line (if current_hunk is None or not raw_line: continue), including one that the hunk header still counts as a context line.
Related issues or fixes / 相关问题或修复
Follow-up to #279 / #284, which pinned the other Git settings that change the patch format.
Activity
fix(work): preserve blank context throughout attempt diffs (Code-Amad…