Skip to content

Commit 33d2e57

Browse files
committed
🔍 Add INFO-level diff debugging to investigate empty PatchSet
🐛 INVESTIGATION: - Unidiff PatchSet is empty despite 16,951 characters of diff content - Both unidiff and manual parser returning 0 files 🔍 DEBUG IMPROVEMENTS: - Show PatchSet file count at INFO level (not DEBUG) - When PatchSet is empty, display: - First 1000 characters of diff content - Total line count - First 10 lines of diff for pattern analysis - Use repr() to show exact content including hidden characters 📊 EXPECTED OUTPUT: Next run should show exactly what the diff content looks like and help identify why unidiff can't parse any files from it.
1 parent e74c4c5 commit 33d2e57

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

gemini_reviewer/diff_parser.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,16 @@ def _parse_with_unidiff(self, diff_content: str) -> List[DiffFile]:
6666
"""Parse diff using the unidiff library."""
6767
try:
6868
patch_set = PatchSet(diff_content)
69-
logger.debug(f"Unidiff PatchSet created with {len(patch_set)} files")
69+
logger.info(f"🔍 Unidiff PatchSet created with {len(patch_set)} files")
70+
71+
# If no files found, show diff preview for debugging
72+
if len(patch_set) == 0:
73+
logger.warning(f"PatchSet is empty! Diff preview (first 1000 chars):")
74+
logger.warning(f"Diff content: {repr(diff_content[:1000])}")
75+
lines = diff_content.split('\n')
76+
logger.warning(f"Total lines: {len(lines)}")
77+
logger.warning(f"First 10 lines: {lines[:10]}")
78+
7079
diff_files = []
7180

7281
for i, patched_file in enumerate(patch_set):

0 commit comments

Comments
 (0)