Skip to content
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

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

Open
abretten opened this issue Jul 18, 2018 · 21 comments
Open

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

abretten opened this issue Jul 18, 2018 · 21 comments
Labels
bug

Comments

@abretten
Copy link

@abretten abretten commented Jul 18, 2018

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.

if (Process.StartInfo.RedirectStandardOutput)
{
Process.OutputDataReceived += (s, e) =>
{
lastOutput = DateTimeOffset.UtcNow;
gotOutput.Set();

bool done = false;
while (!done)
{
var exited = WaitForExit(500);
if (exited)
{
// process is done and we haven't seen output, we're done
done = !gotOutput.WaitOne(100);


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] Trace Logging Enabled
180717-22:00:55.661 TRACE [ 1] needsInvalidation isInitialized:True timedOut:True
180717-22:00:55.666 TRACE [ 1] needsInvalidation isInitialized:True timedOut:True
180717-22:00:55.666 TRACE [59] 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] Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git-lfs\git-lfs.exe locks --json'
180717-22:01:38.830 TRACE [59] 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] 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] needsInvalidation isInitialized:True timedOut:True
180717-22:01:56.810 TRACE [133] Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git-lfs\git-lfs.exe locks --json'
180717-22:02:00.516 TRACE [59] 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] Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git\cmd\git.exe rev-parse --short HEAD'
180717-22:02:00.517 TRACE [137] Running 'C:\Users\Andy\AppData\Local\GitHubUnity\git-lfs\git-lfs.exe locks --json'

@abretten
Copy link
Author

@abretten abretten commented Jul 18, 2018

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 abretten closed this Jul 18, 2018
@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Jul 20, 2018

Glad you figured it out

@RTZCLE
Copy link

@RTZCLE RTZCLE commented Sep 12, 2018

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?

@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Sep 12, 2018

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
Copy link
Member

@StanleyGoldman StanleyGoldman commented Sep 12, 2018

@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?

@paulrayrussell
Copy link

@paulrayrussell paulrayrussell commented Sep 13, 2018

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.

@konstantinkuehn
Copy link

@konstantinkuehn konstantinkuehn commented Sep 14, 2018

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

@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Sep 17, 2018

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?

@konstantinkuehn
Copy link

@konstantinkuehn konstantinkuehn commented Sep 18, 2018

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)

@AllBecomesGood
Copy link

@AllBecomesGood AllBecomesGood commented Sep 25, 2018

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.

@StanleyGoldman StanleyGoldman self-assigned this Oct 3, 2018
@StanleyGoldman StanleyGoldman mentioned this issue Oct 3, 2018
1 of 1 task complete
@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Oct 3, 2018

@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
Copy link
Member

@StanleyGoldman StanleyGoldman commented Oct 4, 2018

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
Copy link
Member

@StanleyGoldman StanleyGoldman commented Oct 5, 2018

🐑 👋 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

@konstantinkuehn
Copy link

@konstantinkuehn konstantinkuehn commented Oct 6, 2018

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 .

@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Oct 7, 2018

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

@StanleyGoldman StanleyGoldman changed the title No files listed in "changes" tab After ~400 changes nothing is listed in "changes" tab Oct 8, 2018
@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Oct 8, 2018

I am finally able to reproduce this

@StanleyGoldman
Copy link
Member

@StanleyGoldman StanleyGoldman commented Oct 9, 2018

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

@Cdddo
Copy link

@Cdddo Cdddo commented May 28, 2019

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).

@KrisITB
Copy link

@KrisITB KrisITB commented Jul 20, 2019

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

@matthaliski
Copy link

@matthaliski matthaliski commented Aug 6, 2019

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.

@tameem-asif
Copy link

@tameem-asif tameem-asif commented Nov 14, 2019

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!

@StanleyGoldman StanleyGoldman removed their assignment Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.