Unity icon indicating copy to clipboard operation
Unity copied to clipboard

GitHub is required for LFS operations

Open GryphonWorx opened this issue 6 years ago • 9 comments

I have not made a Pull Request because this method breaks the intended functionality of the plugin but please read on! :)

I have gotten your plugin to work with any other Git provider using full LFS file locking including the locking list and icons in Unity by simply changing one line in AuthenticationView.cs. Because this fix is so incredibly simple right now, is there any way you could find it in your heart to make this part of the plugin? For example a little button that says "Attempt to use LFS workflow without the incredible GitHub features" or something shorter and sweeter?

There really isn't any other good way to use this incredible plugin for some of us. My current indie group is refusing to use GitHub until we get large enough to support the paid plans so we rely on a locally hosted Git solution instead and I am aware many others are in the same boat.

I realize this might not be in your best interest since you work for GitHub but it might persuade people to jump on the GitHub train once they can afford to do so with larger plans :).

Expected behavior: Successfully use the plugin with another hosted Git service, with full LFS workflow.

Actual behavior: Being able to do so.

Reproduces how often: 100% of the time.

Additional Information

The change in AuthenticationView.cs is on line 210, changing if(success) to just if(true) enables this workaround.

GryphonWorx avatar Aug 31 '18 21:08 GryphonWorx

hey @phrixusgryph this is a git client. We don't have a problem with people using it on other providers. We encourage it.

I wanna help but you didn't say anything about what provider you are using or what is actually wrong.

StanleyGoldman avatar Aug 31 '18 21:08 StanleyGoldman

Thank you for the very prompt response! And that is also quite nice to hear.

We use a self-hosted GitLab-CE installation. Nothing is actually wrong with the plugin as such but it refuses to let us use the locking/unlocking features without logging into a GitHub account. You can still request lock, but while it does lock the file it does not update the context menu to unlock it nor does it update the Locks tab in the plugin UI to show that it's locked. Therefore you can't then release the lock from within Unity.

And as such forcing it to ignore that it failed to log into GitHub by altering the C# code allows this workflow to function regardless.

I should also say that I use an external git client (GitHub Desktop) which has authed already with the server, and as such git itself has stored details it in the Windows Credentials.

GryphonWorx avatar Aug 31 '18 21:08 GryphonWorx

Okay, that makes sense. We can fix that.

StanleyGoldman avatar Aug 31 '18 23:08 StanleyGoldman

Okay we are getting closer, but I need more information.

https://github.com/github-for-unity/Unity/blob/5833fbbcbed4bd2bfe11cc6005079c8853a3226f/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/AuthenticationView.cs#L207-L211

All you are doing on this line of code is forcing the authentication to act like it worked.

Are you saying that the right click option to lock/unlock a file is not available if you are not logged into GitHub?

StanleyGoldman avatar Aug 31 '18 23:08 StanleyGoldman

Thank you! That is really cool of you :)! Let me know if there are any more questions and pardon my peculiar formulation of things, I have the flu and my brain is full of gunk!

GryphonWorx avatar Aug 31 '18 23:08 GryphonWorx

@StanleyGoldman Yes, I changed the if(success) to true to force it to work. The Lock option is available but while it does actually lock the file the plugin UI doesn't update to reflect that it is now locked, and the context menu does not up date to make Unlock and Unlock (Force) options available. It also doesn't put any icons on the files themselves to show their status. The only thing still clickable there is Lock, which tells you that the file is already locked.

GryphonWorx avatar Sep 01 '18 08:09 GryphonWorx

Hey @dborgsh I wanna try to get this fixed up for the next release. I should have a build for you to test out for me a bit later today.

StanleyGoldman avatar Oct 05 '18 14:10 StanleyGoldman

I am Wondering if this got addressed? I would like to look at maybe using this with an internal hosted Git server as our artist machines can't connect to the internet and thus GitHub itself isn't an option.

jwvanderbeck avatar Mar 30 '19 00:03 jwvanderbeck

Trying to setup Github for Unity on an already existing project using Gitlab + LFS completely bricked my git install. Couldn't do anything, error 403 on any operation on any repo even with SSH, had to uninstall git and delete Appdata folder, this needs to be addressed

clorl avatar May 09 '22 19:05 clorl