SRombauts / UEGitPlugin

Unreal Engine 5 Git LFS 2 Source Control Plugin (beta)
http://srombauts.github.io/UEGitPlugin
MIT License
808 stars 165 forks source link

Fix git reset command #61

Closed Butterscup closed 6 years ago

Butterscup commented 6 years ago

I've been using the git plugin available in UE version 4.18.2 (Beta version 1.1). I was unable to delete assets that were added to source control, but not committed. I was also unable to revert them. Renaming them caused duplicate files to appear. After some debugging I found that the plugin was running git --work-tree=<dir> --git-dir=<dir> reset <file> (or for short... git reset <file>), and this was returning the error "fatal: Invalid object name 'C'." I added "HEAD" to the list of arguments to correct the error. It now runs git reset HEAD <file>, and now every file deletion, revert, and rename runs as expected. It seems the line I changed remains unchanged in your current version, and I wanted to share this bugfix. I suspect this might fix your bug #51 as well.

SRombauts commented 6 years ago

Hi @Butterscup, thanks a lot for this fix!

Not sure why the "HEAD" part is not mandatory, and how I got it working at least partially...

I was unable to do as much as I wanted on the plugin lately, but I was just resuming work, so this come at the perfect time :) I'll have to do a before/after check before merging it, but it sounds promising.

SRombauts commented 6 years ago

Hey @Butterscup, sorry for your time, this issue has already been fixed in UE4.19:

So the HEAD part was perhaps another way to fix the problem.

Let me know if you have other problems in 4.19

Edit: 4.19

Butterscup commented 6 years ago

Interesting. My fresh UE source build on 4.18.2 was very much experiencing the issue, which is why I made this change to the source this morning.

SRombauts commented 6 years ago

Sorry @Butterscup, I meant 4.19! I fixed it some 4 months ago, but it was too late for 4.18. So it shipped in 4.19 preview 1

SRombauts commented 6 years ago

I reproduced your issue in 4.18, and verified the fix in 4.19 preview1 a few minutes ago: all is good is this upcoming version.

Do you know you can use the plugin from the current repository in your project "Plugins/" folder to overwrite the default Git v1.x plugin with an "always up to date" dev version? This way you always have latest features as well as fix as soon as they happen

Butterscup commented 6 years ago

No I didn't know that! I'll definitely clone it into my project directory. Thanks for sharing that. :)

SRombauts commented 6 years ago

Great, then please let me know what you think I should improve or fix first!

I am working in fixing the Sync (Pull) command and adding a Push one