Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented remaining git operations #3815

Closed
wants to merge 1 commit into from

Conversation

aishwd94
Copy link

@aishwd94 aishwd94 commented May 5, 2023

Background

Currently, the remaining git commands are not implemented in git_operations.py, due to which, Auto-GPT tries to write a Python script to run those commands. This is less efficient and could be optimized in a straightforward way by implementing and hardcoding the remaining git commands - this would eventually help in solving #15 . These functions are generated by chatGPT itself.

Changes

Added the following git operations:
add, commit, push, pull, init

Documentation

NA

Test Plan

Not tested

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@vercel
Copy link

vercel bot commented May 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) May 5, 2023 2:39am

@Boostrix
Copy link
Contributor

Boostrix commented May 5, 2023

as mentioned in some other issues, coding this up with the hard-coded assumption of using github credentials may have worked initially - but it's obvious that more and more folks are using this with repos beyond just those hosted on github.
Thus, I would suggest to provide an option to also configure these defaults - possibly including the user/email fields, but at least the credentials to login for pulling/pushing respectively.

For the time being, the agent will typically invoke the CLI for me, because the command interface is too limited.

@anonhostpi
Copy link

Added to discussion #3856

@@ -33,3 +33,134 @@ def clone_repository(url: str, clone_path: str) -> str:
return f"""Cloned {url} to {clone_path}"""
except Exception as e:
return f"Error: {str(e)}"

@command(
"add",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the commands to something that relates to git

Copy link
Contributor

@sdfgsdfgd sdfgsdfgd Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making sure the "git" keyword is in the explanation that feeds into the main Prompt, will also prevent hallucination or non-use, because it doesn't know what "git" is either. What is it ? It's the git cmd executable.

GPT still needs a bit of guidance context on commands that it has access to, even if it's slightly complex, just to make sure

do you have a solution that combines this with scraping, so that we can finalise this with ability to open up a Pull Request ? I have this in my fork but I use my own scraping methods to get buttons after push cmd. Can't complain, it works lol

@k-boikov k-boikov added the enhancement New feature or request label May 14, 2023
@Boostrix
Copy link
Contributor

Please consider updating this PR according to the feedback so that it can be considered for the upcoming release.

@Pwuts Pwuts self-assigned this Jul 14, 2023
@@ -33,3 +33,134 @@ def clone_repository(url: str, clone_path: str) -> str:
return f"""Cloned {url} to {clone_path}"""
except Exception as e:
return f"Error: {str(e)}"

@command(
"add",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What @ntindle said:

rename the commands to something that relates to git

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also applies to the rest of the commands

Comment on lines +41 to +42
CFG.github_username and CFG.github_api_key,
"Configure github_username and github_api_key.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These config variables are not needed for this command to function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also applies to the rest of the commands

Comment on lines +111 to +124
@command(
"pull",
"Pull changes from a remote repository",
'"repo_path": "<repo_path>", "remote_name": "<remote_name>", "branch_name": "<branch_name>"',
CFG.github_username and CFG.github_api_key,
"Configure github_username and github_api_key.",
)
@command(
"pull",
"Pull changes from a remote repository",
'"repo_path": "<repo_path>", "remote_name": "<remote_name>", "branch_name": "<branch_name>"',
CFG.github_username and CFG.github_api_key,
"Configure github_username and github_api_key.",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate?

@Pwuts
Copy link
Member

Pwuts commented Jul 17, 2023

Closing this for lack of activity. Please let us know if you still want to get this in. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants