Skip to content

Support Commit Amends#117968

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
sorascode:commit-amends
Apr 1, 2026
Merged

Support Commit Amends#117968
Repiteo merged 1 commit intogodotengine:masterfrom
sorascode:commit-amends

Conversation

@sorascode
Copy link
Copy Markdown
Contributor

@sorascode sorascode commented Mar 29, 2026

This PR adds support for Commit Amends for Editor VCS.

Related Git Plugin PR: godotengine/godot-git-plugin#323

@sorascode sorascode requested review from a team as code owners March 29, 2026 13:28
@YeldhamDev YeldhamDev added this to the 4.x milestone Mar 29, 2026
@sorascode sorascode force-pushed the commit-amends branch 2 times, most recently from 94c35a6 to 24ecf19 Compare March 30, 2026 10:12
@YeldhamDev
Copy link
Copy Markdown
Member

You need to handle the compatibility break: https://docs.godotengine.org/en/latest/engine_details/development/handling_compatibility_breakages.html

@sorascode sorascode requested review from a team as code owners March 30, 2026 17:08
Comment thread misc/extension_api_validation/4.6-stable/GH-117968.txt Outdated
@sorascode
Copy link
Copy Markdown
Contributor Author

@YeldhamDev
Copy link
Copy Markdown
Member

I get this error when trying to amend:

  ERROR: editor/version_control/editor_vcs_interface.h:112 - Required virtual method GitPlugin::_commit must be overridden before calling.

Also, the amending itself doesn't work. I get that it's because it needs to also be implemented in the plugin itself, but that means that the "Amend" toggle is useless for plugins that don't.

Ideally, it should find a way to check if the plugin is capable of this, and only then show the toggle.

@sorascode
Copy link
Copy Markdown
Contributor Author

@YeldhamDev

The error should no longer appear, now there should only be an error if neither the new _commit method nor the now deprecated _commit is overridden. I've also added a new method called _allow_amends, which can be overridden and can return either true or false depending on if the plugin supports amends. If it is not overridden we assume that it does not support amends.

I also have a local version of the Godot Git Plugin which supports amends. I can share the plugin (I can only build for macOS though) or a patch file of the changes.

@YeldhamDev
Copy link
Copy Markdown
Member

You should open a PR with those changes there, so one can test it with this PR.

Comment thread editor/version_control/editor_vcs_interface.cpp Outdated
@sorascode
Copy link
Copy Markdown
Contributor Author

Ok @YeldhamDev. I've made a PR for the Git Plugin: godotengine/godot-git-plugin#323. It uses this version of the cpp bindings: godotengine/godot-cpp#1963. Lmk if you have any issues.

@sorascode
Copy link
Copy Markdown
Contributor Author

I've been informed that one off extension changes should not be done. I've closed the PR. The updated cpp bindings can still be found here https://github.com/sorascode/godot-cpp-soras-version/tree/commit-amends. Or if one only want to override the extension_api.json it can be found here https://github.com/sorascode/godot-cpp-soras-version/blob/commit-amends/gdextension/extension_api.json.

Copy link
Copy Markdown
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

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

Tested on my end, feature works correctly.

@YeldhamDev YeldhamDev modified the milestones: 4.x, 4.7 Mar 31, 2026
@Repiteo Repiteo merged commit 0eee380 into godotengine:master Apr 1, 2026
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Apr 1, 2026

Thanks!

@sorascode sorascode deleted the commit-amends branch April 6, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants