gpt-engineer
gpt-engineer copied to clipboard
Implement (local) git-tracking in version manager
Feature description
In the refactored code (currently on the branch refactor), gpt-engineer holds programs in in-memory Code objects. Writing Code to disk is handled by a VersionManager, with the default implementation https://github.com/AntonOsika/gpt-engineer/blob/refactor/gpt_engineer/core/default/git_version_manager.py .
Despite the suggestive name GitVersionManager, git integration is not yet implemented!
The most basic functionality: When initialized, the git version manager should check if the directory it is in is a git directory and if not, initialize git in it. When calling the snapshot method, the file names in the Code object should be staged and committed with an appropriate message to a branch with an appropriate name.
Probably, reserving one branch name for everything gpt-engineer does is enough, though for working in existing git repos, including uncommitted changes etc, a more advanced design may be considered. GitFlow is always a good guideline: https://datasift.github.io/gitflow/IntroducingGitFlow.html
========================UPDATE================================== After considerations in the maintainer team, the previous GitVersionManager, has been replaced by a simple FileStore. The current plan is to instead make a separate git class, which handles versioning directly in cli/main.py. The git functionality should remain similar to the description above.
Motivation/Application
This makes gpt-engineers modifications to a software reversible and easily trackable, something that has been requested multiple time. This issue supersedes #821 and #793