You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I click "Stage Selected" or "Stage All" I am told "Stage contains 1 file" at the bottom, but the file remains Yellow in the staging area in the UI and the git index is not changed when I look at git status. Commit Changes does commit the staged file, but there is no way for me to see what is staged, and what isn't. Shouldn't staging a file stage in the plugin also stage it in the git index so that the plugin interacts with other git tools correctly? Right now it seems like Godot has its own invisible notion of what is staged and what isn't, that is unrelated to the git index status.
Reacted by bmolyneaux, Andrii Doroshenko and Chandu
This is one oversimplification we had to do to make staging and committing possible in code (libgit2 doesn't seem to have the best documentation so a lot of the implementation we did for v1.x was "figured out" with experimentation).
This was also a glaring weakness in our v1.x which has been since fixed and implemented properly in the upcoming v2.0.
(v2.0 is currently on hold till the GDNative C++ API gets updated for Godot 4.0, see godotengine/godot-cpp#449).
By the way, this could be considered a bug, because staging implies saving the state of the working tree (if I use the terms correctly). I use git add . quite often without committing, so that git history is not so dirty when I do intermediate changes.
This means that when exiting the editor, you may get disappointed due to the fact that those staged changes were not saved in case you did something stupid just before exiting the editor to revert those dirty changes.
Also, I'm in the process of working on built-in integration of Git in Goost, see goostengine/goost#98, and before merging it likely makes sense to resolve this regardless, but I'm not yet sure what to do, need to learn libgit2 API a bit, or perhaps take a look at v2.0 of this plugin (yet I'm working against the v1.0 version in Godot 3.x, so might not be possible to do). Update: resolved this in e320fe9 (#98), that's still v1.0 of the plugin.
The Godot 3.5 beta1 is now live. And along with it, we released a v2.0.0 of this plugin which should fix this issue. Files that are staged in the editor will now appear as staged when checking through git status as well.
Activity
twaritwaikar commentedon Dec 24, 2020
This is one oversimplification we had to do to make staging and committing possible in code (libgit2 doesn't seem to have the best documentation so a lot of the implementation we did for v1.x was "figured out" with experimentation).
This was also a glaring weakness in our v1.x which has been since fixed and implemented properly in the upcoming v2.0.
(v2.0 is currently on hold till the GDNative C++ API gets updated for Godot 4.0, see godotengine/godot-cpp#449).
Xrayez commentedon Jul 10, 2021
Yeah, looks like it just maintains a list of files:
godot-git-plugin/godot-git-plugin/src/git_api.cpp
Lines 81 to 95 in d598850
By the way, this could be considered a bug, because staging implies saving the state of the working tree (if I use the terms correctly). I use
git add .quite often without committing, so that git history is not so dirty when I do intermediate changes.This means that when exiting the editor, you may get disappointed due to the fact that those staged changes were not saved in case you did something stupid just before exiting the editor to revert those dirty changes.
Also, I'm in the process of working on built-in integration of Git in Goost, see goostengine/goost#98, and before merging it likely makes sense to resolve this regardless, but I'm not yet sure what to do, need to learn libgit2 API a bit, or perhaps take a look at v2.0 of this plugin (yet I'm working against the v1.0 version in Godot 3.x, so might not be possible to do). Update: resolved this in
e320fe9(#98), that's still v1.0 of the plugin.twaritwaikar commentedon Jan 14, 2022
The Godot 3.5 beta1 is now live. And along with it, we released a v2.0.0 of this plugin which should fix this issue. Files that are staged in the editor will now appear as staged when checking through
git statusas well.