From 79ae43cb5928a948921acf21e18672b11f854ebd Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 4 Jan 2024 12:23:19 -0800 Subject: [PATCH] make udiff more clear when some hunks did apply --- aider/coders/udiff_coder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aider/coders/udiff_coder.py b/aider/coders/udiff_coder.py index 189aea3e5..1ed587b93 100644 --- a/aider/coders/udiff_coder.py +++ b/aider/coders/udiff_coder.py @@ -38,6 +38,10 @@ The diff needs to apply to a unique set of lines in {path}! {original}``` """ +other_hunks_applied = ( + "Note: some hunks did apply successfully. See the updated source code shown above.\n\n" +) + class UnifiedDiffCoder(Coder): edit_format = "udiff" @@ -110,6 +114,8 @@ class UnifiedDiffCoder(Coder): if errors: errors = "\n\n".join(errors) + if len(errors) < len(uniq): + errors += other_hunks_applied raise ValueError(errors)