From 7a0e020c668643fa616d0d419ca1af25f6f5069a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 18:27:05 -0700 Subject: [PATCH] undo print & reply --- aider/commands.py | 4 +++- aider/prompts.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index d29b40cd7..84df70535 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -107,7 +107,9 @@ class Commands: return self.coder.repo.git.reset("--hard", "HEAD~1") self.console.print( - f"[red]{last_commit.message.strip()}\nThe above commit {self.coder.last_aider_commit_hash} was reset and removed from git.\n" + f"[red]{last_commit.message.strip()}\n" + f"The above commit {self.coder.last_aider_commit_hash} " + "was reset and removed from git.\n" ) return prompts.undo_command_reply diff --git a/aider/prompts.py b/aider/prompts.py index fa6e655bb..8d858bb5c 100644 --- a/aider/prompts.py +++ b/aider/prompts.py @@ -101,3 +101,8 @@ The commit message MUST be in the past tense. It must describe the changes *which have been made* in the diffs! Reply with JUST the commit message, without quotes, comments, questions, etc! """ + +# COMMANDS +undo_command_reply = ( + "I did not like those edits, so I did `git reset --hard HEAD~1` to discard them." +)