mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
Added ability to undo last aider commit.
This commit is contained in:
parent
24593a345f
commit
4fc7b99de4
1 changed files with 5 additions and 0 deletions
|
@ -31,6 +31,7 @@ class Coder:
|
|||
|
||||
last_modified = 0
|
||||
repo = None
|
||||
last_aider_commit_hash = None
|
||||
|
||||
def __init__(self, main_model, files, pretty, history_file, show_diffs):
|
||||
self.history_file = history_file
|
||||
|
@ -245,6 +246,7 @@ class Coder:
|
|||
res = self.commit(history=self.cur_messages, prefix="aider: ")
|
||||
if res:
|
||||
commit_hash, commit_message = res
|
||||
self.last_aider_commit_hash = commit_hash
|
||||
|
||||
saved_message = prompts.files_content_gpt_edits.format(
|
||||
hash=commit_hash,
|
||||
|
@ -484,6 +486,9 @@ class Coder:
|
|||
|
||||
return files
|
||||
|
||||
def cmd_undo(self, args):
|
||||
"Undo the last git commit if it was done by aider"
|
||||
|
||||
def cmd_add(self, args):
|
||||
"Add matching files to the chat"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue