mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
Add --commit flag to commit dirty files without confirmation
This commit is contained in:
parent
f9569e7645
commit
a096c6e5e4
1 changed files with 8 additions and 8 deletions
14
coder.py
14
coder.py
|
@ -473,10 +473,12 @@ class Coder:
|
|||
if not res:
|
||||
self.console.print("[red]Skipped commmit.")
|
||||
return
|
||||
else:
|
||||
|
||||
repo.git.add(*relative_dirty_fnames)
|
||||
repo.git.commit("-m", commit_message)
|
||||
self.console.print("[green]Commit successful.")
|
||||
commit_result = repo.git.commit("-m", commit_message, "--no-verify")
|
||||
commit_hash = repo.head.commit.hexsha[:7]
|
||||
self.console.print(f"[green]Commit successful. Short hash: {commit_hash}")
|
||||
return commit_hash
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -505,7 +507,7 @@ def main():
|
|||
parser.add_argument(
|
||||
"--commit",
|
||||
action="store_true",
|
||||
help="Commit dirty changes to the files",
|
||||
help="Commit dirty files without confirmation",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
@ -515,9 +517,7 @@ def main():
|
|||
pretty = args.pretty
|
||||
|
||||
coder = Coder(use_gpt_4, fnames, pretty)
|
||||
if args.commit:
|
||||
coder.commit("", ask=True)
|
||||
return
|
||||
coder.commit("", ask=args.commit)
|
||||
|
||||
if args.apply:
|
||||
with open(args.apply, "r") as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue