mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
wip
This commit is contained in:
parent
23beb7cb5d
commit
296e7614c4
3 changed files with 47 additions and 82 deletions
|
@ -379,12 +379,7 @@ class Coder:
|
|||
)
|
||||
|
||||
if self.should_dirty_commit(inp):
|
||||
self.io.tool_output("Git repo has uncommitted changes, preparing commit...")
|
||||
self.commit(ask=True, which="repo_files", pretty=self.pretty)
|
||||
|
||||
# files changed, move cur messages back behind the files messages
|
||||
self.move_back_cur_messages(self.gpt_prompts.files_content_local_edits)
|
||||
|
||||
self.dirty_commit()
|
||||
if inp.strip():
|
||||
self.io.tool_output("Use up-arrow to retry previous command:", inp)
|
||||
return
|
||||
|
@ -399,6 +394,27 @@ class Coder:
|
|||
|
||||
return self.send_new_user_message(inp)
|
||||
|
||||
def dirty_commit(self):
|
||||
self.io.tool_output("Git repo has uncommitted changes.")
|
||||
self.repo.show_diffs(self.pretty)
|
||||
self.last_asked_for_commit_time = self.get_last_modified()
|
||||
res = self.io.prompt_ask(
|
||||
"Commit before the chat proceeds [y/n/commit message]?",
|
||||
default="y",
|
||||
).strip()
|
||||
if res.lower() in ["n", "no"]:
|
||||
self.io.tool_error("Skipped commmit.")
|
||||
return
|
||||
if res.lower() in ["y", "yes"]:
|
||||
message = None
|
||||
else:
|
||||
message = res.strip()
|
||||
|
||||
self.commit(message=message)
|
||||
|
||||
# files changed, move cur messages back behind the files messages
|
||||
self.move_back_cur_messages(self.gpt_prompts.files_content_local_edits)
|
||||
|
||||
def fmt_system_reminder(self):
|
||||
prompt = self.gpt_prompts.system_reminder
|
||||
prompt = prompt.format(fence=self.fence)
|
||||
|
@ -508,7 +524,7 @@ class Coder:
|
|||
|
||||
def auto_commit(self):
|
||||
context = self.get_context_from_history(self.cur_messages)
|
||||
res = self.commit(context=context, prefix="aider: ", pretty=self.pretty)
|
||||
res = self.commit(context=context, prefix="aider: ")
|
||||
if res:
|
||||
commit_hash, commit_message = res
|
||||
self.last_aider_commit_hash = commit_hash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue