wip: Added a new prompt message for undo command and updated the message format.

This commit is contained in:
Paul Gauthier 2023-05-10 18:14:47 -07:00
parent bce64f1986
commit 395cf4c14f

View file

@ -1,6 +1,7 @@
import os import os
from rich.text import Text from rich.text import Text
from prompt_toolkit.completion import Completion from prompt_toolkit.completion import Completion
from aider import prompts
class Commands: class Commands:
@ -106,10 +107,10 @@ class Commands:
return return
self.coder.repo.git.reset("--hard", "HEAD~1") self.coder.repo.git.reset("--hard", "HEAD~1")
self.console.print( self.console.print(
f"[red]Undid the last commit: {last_commit.message.strip()}\n" f"[red]{last_commit.message.strip()}\nThe above commit {self.coder.last_aider_commit_hash} was reset and removed from git.\n"
) )
return "I did not like those edits, so I did `git reset --hard HEAD~1` to discard them." return prompts.undo_command_reply
def cmd_diff(self, args): def cmd_diff(self, args):
"Display the diff of the last aider commit" "Display the diff of the last aider commit"