Unity icon indicating copy to clipboard operation
Unity copied to clipboard

After ~400 changes nothing is listed in "changes" tab

Open abretten opened this issue 6 years ago • 21 comments

Edit by @StanleyGoldman


Issue Explanation

Steps to Reproduce

  1. Open new Unity project
  2. Initialize git via the GitHub for Unity
  3. Open a git bash window and generate a lot of changed files using the following command:
    for i in {1..800}; do touch test-file-$i.txt; done
    

Expected Behavior

GitHub for Unity should display all files in the changes view

Actual Behavior

GitHub for Unity should displays an empty changes view

Explanation

The issue is largely around our implementation of ProcessWrapper. We declare an AutoResetEvent called gotOutput that is used to help understand if output is still being returned, but it's been proven that if you can generate enough output, this event does not wait enough time. Increasing the timeout can allow some more input but the ProcessWrapper will also needlessly wait for a lot of commands.

https://github.com/github-for-unity/Unity/blob/e2f8c6221b63a2983bb72950c6e83fa729d5dd98/src/GitHub.Api/Tasks/ProcessTask.cs#L116-L121

https://github.com/github-for-unity/Unity/blob/e2f8c6221b63a2983bb72950c6e83fa729d5dd98/src/GitHub.Api/Tasks/ProcessTask.cs#L150-L157


Original Issue Report

Description

No files ever show in the repository on github, or in the "changes" tab.

Steps to Reproduce

  1. Open existing Unity project
  2. Initialize git via the github window in Unity
  3. All that appears in the github project is: .gitattributes and .gitignore in the project root, as Assets/ folder and in the Assets/ folder a .gitignore file.
  4. Create new sprites (.png) in Assets/ within Unity Editor
  5. NO changes are displayed in the changes tab.

Expected behavior: [What you expect to happen] Expect all files to have been pushed up to github on initial commit. Expect when adding a new file, it to show up in changes tab.

Actual behavior: [What actually happens] No pre-existing unity project files (e.g. *.png, *.asset, *.prefab *.cs) have been copied to github. Nothing useful in the log file (with trace logging enabled).

Reproduces how often: [What percentage of the time does it reproduce?] 100%

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

180717-22:00:45.997 INFO [ 1] <Global> Trace Logging Enabled 180717-22:00:55.661 TRACE [ 1] <GitStatusCache> needsInvalidation isInitialized:True timedOut:True 180717-22:00:55.666 TRACE [ 1] <GitLocksCache> needsInvalidation isInitialized:True timedOut:True 180717-22:00:55.666 TRACE [59] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git\cmd\git.exe -c i18n.logoutputencoding=utf8 -c core.quotepath=false status -b -u --porcelain' 180717-22:00:55.671 TRACE [122] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git-lfs\git-lfs.exe locks --json' 180717-22:01:38.830 TRACE [59] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git\cmd\git.exe -c i18n.logoutputencoding=utf8 -c core.quotepath=false status -b -u --porcelain' 180717-22:01:39.293 TRACE [130] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git\cmd\git.exe -c i18n.logoutputencoding=utf8 -c core.quotepath=false status -b -u --porcelain' 180717-22:01:56.804 TRACE [ 1] <GitLocksCache> needsInvalidation isInitialized:True timedOut:True 180717-22:01:56.810 TRACE [133] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git-lfs\git-lfs.exe locks --json' 180717-22:02:00.516 TRACE [59] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git\cmd\git.exe -c i18n.logoutputencoding=utf8 -c core.quotepath=false status -b -u --porcelain' 180717-22:02:00.517 TRACE [136] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git\cmd\git.exe rev-parse --short HEAD' 180717-22:02:00.517 TRACE [137] <ProcessWrapper> Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git-lfs\git-lfs.exe locks --json'

abretten avatar Jul 18 '18 02:07 abretten

ok closing this, sorry git / code control newbie here. for a brand new project in unity, i was finally able to see assets in the "changes" tab. I had to select those files in that tab, then enter a commit "summary" and "description" which then allowed me to click the "commit to master" button at the button, and after that i could click push, and finally i see files in github. I dont know why my original project i added the git4unity asset to is showing no files in the "changes" tab, but I'm just going to copy the few files i have so far into a new Unity project.

abretten avatar Jul 18 '18 03:07 abretten

Glad you figured it out

StanleyGoldman avatar Jul 20 '18 12:07 StanleyGoldman

Not sure why this is closed. This does not feel like a solution to the problem. You shouldn't have to create a brand new unity application just to get GIT to recognize there are "changes" to the repo. I just created a brand new project, copied other files over and its still not even picking those up. Thoughts?

RTZCLE avatar Sep 12 '18 04:09 RTZCLE

Hey @RTZCLE

I'm assuming that @abretten closed the issue because maybe he fixed something that he was doing incorrectly. This definitely should not be the case in general.

StanleyGoldman avatar Sep 12 '18 14:09 StanleyGoldman

@RTZCLE There is nothing in the previous issue that I can use to debug...

Can you start by telling me if you are able to reproduce this everytime? Also, what version of Unity, Windows/Mac? Are you able to turn on trace logging and capture anything?

StanleyGoldman avatar Sep 12 '18 20:09 StanleyGoldman

I've been working for a few hours on a new project. Added Github integration at the start. Everything was working, I changed Camera angle, and it was picked up by Github GUI as a change.. I did a test commit and push. All ok. So I got back to work. Then just now, I've checked Unity GIT GUI, and none of my changes have been added. i.e "No files listed in "changes" tab". I've gone into command. "git status" reveals that all the files are changed, but none are showing in the Unity GUI. I've command line "git add -A", now I can see hundreds of files ready to add. Still no show in GUI. I restart Unity. No change. I do "git commit" then "git push origin master" files go to server. Still not a twitch out of Unity GUI. Unity 2018.2.6f1. 64 bit. Windows 10. Git 2.18.0.windows.1. I'm using System GIT, which I downloaded just now. Hope this helps - important plugin IMO.

saulrussell avatar Sep 13 '18 08:09 saulrussell

Same as described. Unity Git doesnt seem to track new files when added via explorer.

I had a very massive project which I tried to push with the Unity for GitHub but I had to apply all changes via console since the UI didnt fetched it for some reason.

Using Window 10 Unity 2018.2.7f1
Github for Unity 1.0.3

konstantinkuehn avatar Sep 14 '18 12:09 konstantinkuehn

Hey @paulrayrussell @konstantinkuehn. Thanks for testing our stuff out and coming here to report issues.

I fixed a few issues and I'm coming around to this one now.

I need a bit more from you guys though. Can either of you try to capture trace logs when things are not working?

StanleyGoldman avatar Sep 17 '18 19:09 StanleyGoldman

How you can try to reproduce it:

  1. Make a project without git for unity.
  2. Load in some Assets
  3. Copy this Project
  4. Open the copy Project
  5. Import Git For Unity
  6. Set it up
  7. Nothing of the Assets will be marked as a new File so there is no way to add the Project to git via the UI

If this isnt reproduce able it might be possible that it is also an result from using before the Unity built in Collab Feature or the Size of the Project.

At the end the fix for this is very simple. git add -A git commit git push

After this is done future changes will be tracked in the ui.

In my case the git add -A took over 2 hours maybe this is also a reason why it wasnt done by the ui itself( might would have killed unity)

konstantinkuehn avatar Sep 18 '18 08:09 konstantinkuehn

For me this issue was caused by me adding another build folder with a different name that wasn't in the gitignore. It was just above 500MB large and then no changes were shown in the Github for Unity UI.

AllBecomesGood avatar Sep 25 '18 20:09 AllBecomesGood

@abretten @RTZCLE @paulrayrussell @konstantinkuehn @AllBecomesGood

Sorry it's taken so long, this problem is obscure. I believe you are all "stuck" in a state where your cache has invalidated, it tried once to validate it, and it no longer attempts to validate. So your logs show up empty.

I think I have gotten closer to solve the issue, but I need your help in testing this next build.

https://ci.appveyor.com/api/buildjobs/ehbdp9cf383c4lj7/artifacts/github-for-unity-1.1.0.6098.unitypackage

This may not fix your error, but it will allow the "Refresh" button to "try again". And hopefully between that and the new logs we capture, we can solve all of your problems.

Please give it a shot and let me know how it goes.

StanleyGoldman avatar Oct 03 '18 18:10 StanleyGoldman

My build server screwed me and that previous link won't install correctly. Unzip and try this instead.

github-for-unity-1.1.0.4987-360a4850.unitypackage.zip

StanleyGoldman avatar Oct 04 '18 18:10 StanleyGoldman

🐑 👋 I know we've taken a long time to figure this one out, but I'd like to get it figured out for the next release. 😅 @abretten @RTZCLE @paulrayrussell @konstantinkuehn @AllBecomesGood

StanleyGoldman avatar Oct 05 '18 14:10 StanleyGoldman

I unfavourable fixed it myself via console. I think to many changes once will overload the ui. I had to add all files manual via console. Which tooked in my case 3 hours. But after it the ui in unity was able to track it .

konstantinkuehn avatar Oct 06 '18 21:10 konstantinkuehn

👍 @konstantinkuehn cool, I'm happy you got through it at least.

StanleyGoldman avatar Oct 07 '18 14:10 StanleyGoldman

I am finally able to reproduce this

StanleyGoldman avatar Oct 08 '18 16:10 StanleyGoldman

Now that I understand the problem in more detail, I updated the original issue body.

StanleyGoldman avatar Oct 09 '18 12:10 StanleyGoldman

Also have this problem. Initializing Github for Unity on an old project. Nothing shows up in changes tab. In history it automatically makes an initial commit, but only the .gitignore, .gitattributes... Here's the log.

Adding the repo to Github Desktop shows all the changed files just fine (over 2000).

Cdddo avatar May 28 '19 00:05 Cdddo

I had the same issue as described by Cdddo, in my case I had a fresh system and with only windows github gui installed. Cdddo can you check if cli works when you start it from unity? In my case it didn't so I figured I'll install the standard git cli. Afterwards unity started picking up on files as expected

KrisITB avatar Jul 20 '19 21:07 KrisITB

Just a heads up for others.

I too had a problem with changed files not appearing under the changes tab. A git status on the command line showed plenty of modified files, but nothing in GitHub for Unity. Turns out it was an easy fix and I had the incorrect path to my system git. The project had been setup with the git path being usr/local/bin/git, but my path is actually just usr/bin/git. Once I updated it and saved I saw all the changed files.

Now, I have no idea why that location changed from previous projects where the correct path was the default 🤷‍♂ . Anywhoo, maybe this helps some folks.

matthaliski avatar Aug 06 '19 18:08 matthaliski

I had the same problem when I was working on a project on MacOS. In my case, I added a new package to Unity and GitHub for Unity just stopped detecting all changes. I solved the problem by reinstalling git-lfs using brew install git-lfs. Once I did this, I was able to add/commit/push through the Terminal. After that manual push, GitHub for Unity GUI started working properly.

Hope that helps!

tameem-asif avatar Nov 14 '19 17:11 tameem-asif