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

VCS integration for Godot Editor #31461

merged 3 commits into from Sep 3, 2019


Copy link

commented Aug 18, 2019

Godot version:

Feature description:

This project is a part of Google Summer of Code 2019, which will be ending soon. I am Twarit Waikar and I was mentored by @groud and @jahd2602 for the entire program.

The VCS integration makes Godot aware of being in the presence of a version control system, applies basic VCS initialisations, version diffing, staging, committing from within the editor. This makes the Godot editor more favourable for people who use their VCS intensively while iterating.

The integration is in an improvable state and lays down the groundwork for more advanced VCS data visualisations and editions to be implemented in the future. The feature is currently only implemented for Git, as planned for GSoC 2019. However, the same API can be implemented for some other VCS and that should work fine too.

Instructions for testing the Git API

Currently the GDNative plugin is available at And it requires the user to build the plugin themselves. A release will be made soon that provides binaries for all platforms.

I have provided the demo project from the above-mentioned Git API repository that has the binaries for Windows currently. The build instructions for Linux are provided in the repository.

[EDIT] Windows and Linux binaries are included in the demo project folder. Just download the demo folder as is.

  1. Extract the demo project present here
  2. Open Godot Project Manager. Select the newly extracted demo project.
  3. Select Project > Version Control > Set Up Version Control.
  4. In the popup, select GitAPI. If you don't see this option, it means that Godot can't find the GDNative plugin. Verify if you have the correct project open.
  5. Next, you will see the Version Control dock appear at the bottom and the Commit panel appear on the right-hand side (alongside Inspector and Node panels).
  6. Try to follow the same workflow as the VCS integration present in VSCode/VS/Atom etc. i.e. make a change to a file, see it get reflected in the stage area, stage the file, add a commit message, and commit the file.
  7. When you are done, you can select Project > Version Control > Shut Down Version Control to remove all VCS UI.

Use cases:

  • Introducing Git project management from within the editor
  • Creating diff for text files and displaying them so as to implement features like #25442.
  • Providing a singular interface for Git/SVN/Perforce/etc. through a single EditorVCSInterface class. Documentation for the interface will be pushed soon so that similar Editor Wide plugins can be implemented for Perforce/SVN/Mercurial etc.
  • Addresses #25542
  • Implements the backend linkages required for #25442 and #27984 and a few more (which I probably didn't notice)

@IronicallySerious IronicallySerious force-pushed the IronicallySerious:add-vcs-integration branch 3 times, most recently from 804f16d to e118e6a Aug 18, 2019


This comment has been minimized.

Copy link
Member Author

commented Aug 18, 2019

This may not be merged yet.

I am still writing the API documentation and I would probably like to receive inputs from the community to incorporate necessary changes
Documentation is up now. Looking for reviews

@IronicallySerious IronicallySerious requested a review from godotengine/documentation as a code owner Aug 20, 2019

@akien-mga akien-mga added this to the 3.2 milestone Aug 22, 2019


This comment has been minimized.

Copy link
Member Author

commented Aug 23, 2019

The staging area UI is needing some changes as @groud had recommended. I will be working on these.

The change I am making is that the file status should be reflected by the color of the font that it appears in or the tag added to its file name e.g. (deleted). Right now all files are categorized in the staging area according to their change type.

The per-file change color has been implemented now. Looking for feedback

@IronicallySerious IronicallySerious force-pushed the IronicallySerious:add-vcs-integration branch 2 times, most recently from d4abd3c to b57c061 Aug 24, 2019

@akien-mga akien-mga requested a review from groud Sep 3, 2019

groud approved these changes Sep 3, 2019

This comment has been minimized.

Copy link

commented Sep 3, 2019

Haven't had time to review yet, but just noting down for potential merge (me later or anyone else): 86 commits sounds like a ton, this should likely be squashed into a smaller number.

@IronicallySerious IronicallySerious force-pushed the IronicallySerious:add-vcs-integration branch from b57c061 to 272af74 Sep 3, 2019

@IronicallySerious IronicallySerious requested a review from neikeq as a code owner Sep 3, 2019

@IronicallySerious IronicallySerious force-pushed the IronicallySerious:add-vcs-integration branch from 272af74 to 24e7979 Sep 3, 2019

Add version control editor plugin
Provides the editor with all the VCS GUI and extracts the data from the
upcoming VCS API to cater to the project with VCS interaction.
Add an overridable VCS Interface for the editor
The VCS interface can be thought of like a proxy system, where any call
to the API is redirected to the actual implementation of the VCS API
which may be existing in the form of a GDNative plugin which is marked
as a singleton and is not marked reloadable. If the implementation
doesn't exist in the file system, it only returns the default responses which contain
mostly empty containers of the data type that every API call returns.

EditorVCSInterface is used like a Godot object with a script attached to it. The script
is the implementation of the API and the object is the interface to the
script, which returns default responses if the script doesn't exist or
if the script doesn't define a function that handles that particular API call.

The entire system has been implemented using Object::call() and its
ability to switch to the script instance to handle the API call if the
script exists. Look for VersionControlEditorPlugin::_initialize() for
the essential API setup.

@IronicallySerious IronicallySerious force-pushed the IronicallySerious:add-vcs-integration branch from 24e7979 to 20961a8 Sep 3, 2019

@IronicallySerious IronicallySerious force-pushed the IronicallySerious:add-vcs-integration branch from 20961a8 to d98e944 Sep 3, 2019


This comment has been minimized.

Copy link
Member Author

commented Sep 3, 2019

This branch has been basically re-made to remove the excessive amounts of commits that eventually compile with a future commit.

To see the actual history of the project, go to
The above linked branch was also cleaned up to remove the useless experiments we made with the codebase.

@akien-mga akien-mga merged commit 4967f30 into godotengine:master Sep 3, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Copy link

commented Sep 3, 2019

Thanks a ton for your work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.