[Concept,24/29] patman: Tell the agent never to reconstruct quoted diff lines

Message ID 20260501110040.1874719-25-sjg@u-boot.org
State New
Headers
Series patman: Review-flow improvements and shared helpers |

Commit Message

Simon Glass May 1, 2026, 11 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

The review agent occasionally mixes content between nearby macros or
functions when quoting the diff, so the comment ends up pointing at a
problem that does not exist in the patch.

Add a strong rule that every quoted line must be copied verbatim from
'git show', not reconstructed from memory.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/review.py | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.43.0
  

Patch

diff --git a/tools/patman/review.py b/tools/patman/review.py
index c173a9938d5..29f618641bd 100644
--- a/tools/patman/review.py
+++ b/tools/patman/review.py
@@ -389,6 +389,14 @@  Rules:
 
     This include is unnecessary.
 - Quote enough context from the diff to identify the location
+- CRITICAL: Every quoted line MUST be copied EXACTLY from the output
+  of 'git show {commit_hash}'. Do NOT reconstruct, paraphrase, or
+  combine lines from memory. Do NOT mix content between nearby macros,
+  functions or files. If you need to check a line before quoting it,
+  run 'git show {commit_hash}' again and copy the characters exactly,
+  including whitespace, punctuation, and backslashes. A comment that
+  points at a problem in a quoted line that does not actually exist
+  in the patch is worse than no comment at all.
 - Be specific and constructive, but brief — use as few words as
   possible to make the point. Avoid restating what the code does;
 - NEVER use backticks — this is plain-text email, not markdown.