Skip to content

Instantly share code, notes, and snippets.

@Janglee123
Last active August 28, 2020 09:29
Show Gist options
  • Save Janglee123/e67f9034d6475cc40e204d24b9dc1aa1 to your computer and use it in GitHub Desktop.
Save Janglee123/e67f9034d6475cc40e204d24b9dc1aa1 to your computer and use it in GitHub Desktop.
GSoC Project reports

Version Control Systems Improvements - Meru Patel

Introduction

Following to last project report, this report will introduce the quality of life updates, fixes and new features.

What is new?

Line change gutters for the script editor.

Yes, the built-in script editor will show the line change gutters as typed just like favourite code editors.

Autoloading the plugin on startup.

Now, Editor detects and load the plugin on startup. There is no need to manually set up a plugin each time, once it gets initialised. The project settings have a version control field for the purpose. It allows changing the settings anytime from project settings.

Code refactor and API changes for VCS Interface.

Version control plugins are unique compare to regular addons. They have dedicated interface built on EditorPlugin class which communicates with integrals part of the Editor. Unlike other addons, version control interface needs more data in special structures in every operation. C++ Uses struct to felicitate custom data structure and GDScript has Dictionary for the same. As core data structures are not exposed to GDScript/GDNative, and use of Dictionary in C++ with string indexes is error-prone, the interface has to convert Dictionary into nicely suited struct for the C++. As a solution, the interface now provides helper functions. These functions ensure the correct structure of a Dictionary for data and later convert them to struct for c++.

Error popups

Error popup is a small but impactful improvement. The new interface provides more operations then commit and stage/unstage. The new set of features requires better error handling. As an example, it is more likely to get an error message that "you have uncommitted changes" while performing operations like branch checkout or pull. The popups will grab attention faster compare to the output log.

And many other small fixes and improvements.

Coming up next

This report is supposed to be the last progress report and the end of the GSoC project. However There are many possibilities for VCS. Here are a few ones,

  • Adding more advanced UI hooks for plugin and interface, like amend commit, revert commit, stash, multi remote support.
  • Code editors like VSCode or Atom have a nice feature to auto sync with a remote. They stash current changes pull from remote and unstash changes back. This would be nice to have in Godot editor.
  • Integrating VCS into other editor modules like file system dock or having support for resolving merge conflicts.

You are more than welcome to contribute to VCS integration and the godot-git-plugin. You can join the IRC channel #godotengine-vcs to discuss the development.

Version Control Systems Improvments - Meru Patel

Introduction

Godot 3.2 introduced the version control system(VCS). The initial project to integrate VCS (Version Control System) into Godot was created in GSoC 2019 by Twarit Waikar. It introduced in-editor GUI, an interface and git-plugin. The interface provides API points to communicate with the in-editor GUI. Any version control framework can be implemented on top of the interface API. This project aims to improve the compatibility, usability and reliability of the VC system of godot and godot-git-plugin.

Whats new?

Initial project had been an excellent effort. However, there were many things to improve. It provides stage, unstage, commit and display diff of unstaged changes. This GSoC project adds new essential features which were not available. The goal is to cover all basic VCS operations so that you don't have to leave the editor. There are also lot of bug fixes and stability enhancements.

A new ui of commit dock with new git operations

The new commit dock has designed from scratch. The previous commit dock was little bit confusing. New dock has comprehensive list of both staged and unstaged changes. You can stage/unstage a single change or all changes with one button. This also comes with UI buttons to opening or discarding changes from a list. At the bottom of commit dock, a new list of previous commits has been added. It reveals last few commits with names of author.

Remote and branch support

Remote support was most requested feature from users. I am very excited to announce that new version will come with pull, push and fetch operations. Now you can perform any of this operation inside the editor with a single click. You have to provide credentials in set up dialog box to work with remote. Although in favor to support private repositories, pull and fetch also require credentials. For now, remote origin is hard-coded so it only can connect with origin. You can use GitHub Id and password to connect with remote repository on GitHub. Another small but important feature added is the branch checkout. You can checkout a branch from list of local branches with new release.

Diff View

A new diff view replce old traditional command-line output with comparative list. This is work in progress and near to finish. It provieds two split and unified view of diff. You can see the diff of stage/unstaged file or a full commit change from the previous commit list.

How it looks

Here is new UI of Commit dock. It is inspired from Atom's github package.

Coming up next

The next planned feature is gutter indicators in script editor for line changes. I am also considering to restructure the plugin in order to make it an add-on and upload it to the Asset store. This will make installation process quick and simple instead of downloading manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment