Version Control System (VCS) interface, which reads and writes to the local VCS in use.
Defines the API that the editor uses to extract information from the underlying VCS. The implementation of this API is included in VCS plugins, which are GDExtension plugins that inherit EditorVCSInterface and are attached (on demand) to the singleton instance of EditorVCSInterface. Instead of performing the task themselves, all the virtual functions listed below are calling the internally overridden functions in the VCS plugins to provide a plug-n-play experience. A custom VCS plugin is supposed to inherit from EditorVCSInterface and override each of these virtual functions.
Commits the currently staged changes and applies the commit msg to the resulting commit. If amend is true the commit will modify the most recent commit instead.
Creates a new remote destination with name remote_name and points it to remote_url. This can be an HTTPS remote or an SSH remote.
Fetches new changes from the remote, but doesn't write changes to the current working directory. Equivalent to git fetch.
Returns an array of Dictionary items (see create_diff_file(), create_diff_hunk(), create_diff_line(), add_line_diffs_into_diff_hunk() and add_diff_hunks_into_diff_file()), each containing information about a diff. If identifier is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff.
Returns an Array of Dictionary items (see create_diff_hunk()), each containing a line diff between a file at file_path and the text which is passed in.
Returns an Array of Dictionary items (see create_status_file()), each containing the status data of every modified file in the project folder.
Returns an Array of Dictionary items (see create_commit()), each containing the data for a past commit.
Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at project_path.
Pushes changes to the remote. If force is true, a force push will override the change history already present on the remote.
Set user credentials in the underlying VCS. username and password are used only during HTTPS authentication unless not already mentioned in the remote URL. ssh_public_key_path, ssh_private_key_path, and ssh_passphrase are only used during SSH authentication.
Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI.
Helper function to create a commit Dictionary item. msg is the commit message of the commit. author is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. id is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. unix_timestamp is the UTC Unix timestamp of when the commit was created. offset_minutes is the timezone offset in minutes, recorded from the system timezone where the commit was created.
Helper function to create a Dictionary for storing old and new diff file paths.
Helper function to create a Dictionary for storing diff hunk data. old_start is the starting line number in old file. new_start is the starting line number in new file. old_lines is the number of lines in the old file. new_lines is the number of lines in the new file.
Helper function to create a Dictionary for storing a line diff. new_line_no is the line number in the new file (can be -1 if the line is deleted). old_line_no is the line number in the old file (can be -1 if the line is added). content is the diff text. status is a single character string which stores the line origin.
Helper function to create a Dictionary used by editor to read the status of a file.
Pops up an error message in the editor which is shown as coming from the underlying VCS. Use this to show VCS specific error messages.
CHANGE_TYPE_NEW = 0A new file has been added.
CHANGE_TYPE_MODIFIED = 1An earlier added file has been modified.
CHANGE_TYPE_RENAMED = 2An earlier added file has been renamed.
CHANGE_TYPE_DELETED = 3An earlier added file has been deleted.
CHANGE_TYPE_TYPECHANGE = 4An earlier added file has been typechanged.
CHANGE_TYPE_UNMERGED = 5A file is left unmerged.