From 82dc995a0451baa5780c770b45064c0df82fc836 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 18 Oct 2023 11:38:54 -0700 Subject: [PATCH] Added helpful suggestions to /undo and /diff errors --- aider/commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aider/commands.py b/aider/commands.py index 110a1cda7..1c869b4b1 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -210,6 +210,10 @@ class Commands: or last_commit.hexsha[:7] != self.coder.last_aider_commit_hash ): self.io.tool_error("The last commit was not made by aider in this chat session.") + self.io.tool_error( + "You could try `/git reset --hard HEAD^` but be aware that this is a destructive" + " command!" + ) return self.coder.repo.repo.git.reset("--hard", "HEAD~1") self.io.tool_output( @@ -229,6 +233,7 @@ class Commands: if not self.coder.last_aider_commit_hash: self.io.tool_error("No previous aider commit found.") + self.io.tool_error("You could try `/git diff` or `/git diff HEAD^`.") return commits = f"{self.coder.last_aider_commit_hash}~1"