Skip to content

Locked files locked for lock requester, release option not available #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BlurEffect opened this issue Feb 6, 2020 · 3 comments
Open

Comments

@BlurEffect
Copy link

Description

Hi everbody,
I have added the Git for Unity package to one of my projects (which was already under source control) and while locking seems to work mostly fine, there still is a weird issue with it. My repository is not on GitHub but on Bitbucket within a corporate environment and I am using Unity 2019.3 (but I'm having the same issue with 2019.2). Requesting a lock works fine and it will show me the little icon next to the locked file and the lock will appear in the list of locks. However, when right-clicking the locked element, the "release" option is greyed out and I can only force unlock it, although I am the person that requested the lock. I assume, that I should be able to simply release the lock. In addition, when locking a vfx graph in Unity with your plugin (and possibly other elements?), I am not able to edit the graph since I am getting a "Asset is locked" notification instead of the graph being displayed. Can you please help me with this issue and provide some assistance? As mentioned above, it's a corporate environment with a proxy server and stuff but all the git stuff works fine on the command line. I also opened this issue for the original "Github for Unity" plugin here on Github since I am having the exact same issue with that one.

Steps to Reproduce

  1. Open Unity project
  2. Request lock on object
  3. Try to release lock/edit locked element (for instance vfx graph)

Expected behavior: Since I locked the file, I should be able to still edit it and to release the lock

Actual behavior: Release option is greyed out (force release is working though) and element is locked for me although I requested the lock (at least I cannot edit a locked vfx graph, I didn't try this for many different types of objects)

Reproduces how often: Every time

Additional Information

Here is the log file (opening the project, requesting a lock and eventually force releasing it):

git-for-unity - Kopie.log

@shana
Copy link
Contributor

shana commented Sep 15, 2020

This issue is quite old (sorry about that, covid threw a wrench onto things...), but for googling reference, here's what's happening.

@BlurEffect The reason it only shows you a force release is because it doesn't know that you're the same user that locked it. That feature was originally written to match your github username to the username that the github lfs server reports, but Git for Unity doesn't include any GitHub features, and therefore doesn't include the logic to retrieve github usernames to match against what lfs reports. This is also happening on the GitHub for Unity plugin because you're not using a GitHub server, and therefore it has no idea that you are you.

The general problem is that

  • lfs servers can choose to use whatever identity providers they want
  • an lfs server is completely separate from a git server
  • git isn't necessarily tied to the same identity provider, so who you are on git might not be who you are on lfs
  • lfs doesn't have an API for querying who it thinks you are

Therefore, matching identities is kinda hard, and this UI is not really well suited for dealing with that. There's hacks I could do, like locking a file for a second just to see who lfs thinks you are, and store that info, but all of that is really brittle and can easily fail. I should probably make the Unlock action always available regardless of whether I think it can work or not, at least that would make a user feel less bad about it, I guess.

Regarding the vfx graph not displaying when it's locked, that's an unfortunate side effect of this whole mismatched identity thing, it thinks someone else has locked it. One of features of the whole locking system is for you to be able to be warned about touching things that someone else has locked, so taking that out entirely would remove the purpose of the thing... maybe the easiest way here is for you to just tell the plugin your username on lfs, that way things will work as expected. I'll see what I can do for the next release.

@juanimator
Copy link

Shana, Thanks for your hard work on this project!

I don't know how to vote for issues, but this is one I'd like to see addressed.

I'm not a coder but it doesn't seem that the unlock command needs a username. So maybe like you said the unlock menu item in the right-click project menu and in the Locks tabs could always available, and the user just needs to check the Locks tab to see if the unlock worked.

My opinion on the "Asset is Locked" issue is that Unity should never block you from making changes locally. If it knows the asset is locked a pop up warning or an overlay would be better. But that's probably not in the scope of the your project.

@Edvinas01
Copy link

Is there a workaround for this?

Some of my team members (on Windows and Mac) are experiencing this issue. The usernames and emails are properly set in git config to match the ones in GitHub, however the unlock function is still greyed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants