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

Index file in Git repository constantly updating #2595

Closed
JonCognioDigital opened this issue Feb 1, 2016 · 29 comments
Closed

Index file in Git repository constantly updating #2595

JonCognioDigital opened this issue Feb 1, 2016 · 29 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s)
Milestone

Comments

@JonCognioDigital
Copy link

Hi,

Ever since installing VS Code I seem to have a problem with Git/Dropbox.

Whenever I have a folder open in VS Code which is a git repository it seems to constantly update the index file and the FETCH_HEAD file. I don't mean every time I save a file, I mean every few seconds.

This causes a problem with Dropbox because I'm using it to sync files between my home and work computers. The notifications in the bottom right of my screen keep coming thick and fast and it's driving me crazy. Not to mention that Dropbox is constantly uploading files because it thinks they've changed.

Anyone else having this problem?

Version of VS Code: 0.10.6

@joaomoreno
Copy link
Member

VSCode spawns git for its git operations. Every now and then it spawns git status to know whether something has indeed changed. This touches the index, which modifies some files within the .git directory. This will likely not change in the near future.

Some information on how to effectively use Dropbox with git can be found one Google search away.

@JonCognioDigital
Copy link
Author

I know how to "effectively use Dropbox with git", thanks. Your answer sounded a bit condescending at the end there.

Dropbox with Git works fine for me. It works with Visual Studio and it works with Sublime text. The problem here is with VS Code, not my setup.

If this isn't going to be fixed any time soon then that's not a problem, I can just go back to using Sublime text, but I was trying to report a problem to help you guys, I wasn't expecting attitude in return.

Jon

@joaomoreno
Copy link
Member

@jon64digital Apologies, I didn't mean to come off condescending.

Don't you see the index and FETCH_HEAD files being touched when using git from the command line as well? Namely, when running git status?

How about when you run git fetch? Do those files change? If so, you can disable our automatic git fetch calls by changing the setting git.autofetch to false.

@JonCognioDigital
Copy link
Author

Hi João,

I will try both of those when I am next using my laptop.

However, I don't think that is my problem. I suspect that those files will change when I use git from the command line, but I expect things to change when using git.

My problem is that this doesn't just happen when using git inside of VS Code, it happens all the time that VS Code is running, even when I am not touching the computer. I can sit back in my chair and watch it updating every few seconds without interacting with it. So VS Code is doing something in the background constantly that other code editors don't do which is touching the git Index and Fetch_head files.

I can't just un-sync these files from dropbox unfortunately, otherwise I assume the git repository would be out of sync between my laptop and work PC.

@joaomoreno joaomoreno reopened this Feb 2, 2016
@joaomoreno
Copy link
Member

Alright, let's fix that then! 👍

@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Feb 2, 2016
@joaomoreno joaomoreno added this to the Feb 2016 milestone Feb 2, 2016
@JonCognioDigital
Copy link
Author

I'll keep an eye on this. Let me know if I can be of any help.

@JonCognioDigital
Copy link
Author

This may be premature, bit I think it may be fixed. I recently updated VScode and right now I have it open with dropbox on and I'm not getting constant notifications saying that those files have been changed.

@joaomoreno
Copy link
Member

That is strange, we didn't do anything to change this. Are you sure it's not a problem to you anymore?

@JonCognioDigital
Copy link
Author

That is very strange. I haven't changed anything on my PC in the last week except for updating VScode. Still no sign of it happening after 3 days on the new version.

@joaomoreno
Copy link
Member

Closing then. We can always reopen if it comes back. Thanks for the info.

@JonCognioDigital
Copy link
Author

Sorry, but it came back last night.

I'm not sure how I can help, other than to record a video of it? Not sure that would help though as it would only show you what I'm describing. Or I could try sending you copies of the index file?

I have tried taking two copies of the index file after it says it's been modified to see if it has actually been modified, but I can't even open it in VS code as it's a binary file.

And the fact that it didn't do it for a couple of days during which I had dropbox switched on is an absolute mystery. My PC in the office doesn't do it either. However I know it's VS Code doing it because it stops happening as soon as I switch VS Code off :(

@joaomoreno joaomoreno modified the milestones: Backlog, Feb 2016 Feb 26, 2016
@joaomoreno joaomoreno reopened this Feb 26, 2016
@pantulis
Copy link

I'm observing the same behaviour when running VS Code against a Dropbox folder managed via git.

I don't know if this can be classified as a bug in Code itself --it's as easy as not leaving VS Code running when you're at your other computer. But the behaviour is somewhat confusing.

@JonCognioDigital
Copy link
Author

Hi @pantulis

Not sure if we're experiencing the same thing as my other PC at work is hibernated when I experience this at home.

@toepoke
Copy link

toepoke commented Apr 11, 2016

+1 I also have the same problem, but only on my home PC, which is Windows 10 ... if that helps!

Working around it by pausing Dropbox sync and [hopefully remembering to] turn it back on when I'm done ... which kinda defeats the point ;-)

@joaomoreno
Copy link
Member

Closing as a duplicate of #901.

Fix will come to:

  1. Disable auto status when application is not in foreground and,
  2. Provide setting (or checkbox in viewlet) to disable auto status altogether.

@joaomoreno joaomoreno added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 6, 2016
@chihyaoma
Copy link

chihyaoma commented Mar 8, 2017

Hi,

I am facing the same issue both on my Ubuntu 14.04 and MacOS 10.12.3 using VSCode 1.10. Not sure if you guys fixed it or not.

I can still see that index file from Dropbox constantly updating and create conflict files, even if the VSCode is just running in the background.

@nox
Copy link

nox commented Mar 26, 2017

Don't you see the index and FETCH_HEAD files being touched when using git from the command line as well? Namely, when running git status?

How about when you run git fetch? Do those files change? If so, you can disable our automatic git fetch calls by changing the setting git.autofetch to false.

The only way to make Git touch FETCH_HEAD is to make it fetch a specific branch on a specific remote, and Git will set FETCH_HEAD to that branch's tip. Under no reason VSCode should ever touch FETCH_HEAD itself, let alone overwrite it.

I filed #23153 about this.

@pschfr
Copy link

pschfr commented Jun 8, 2017

This is still happening to me with Ubuntu 17.04 and Windows 10, running VSCode 1.12 :(

@mileusna
Copy link

mileusna commented Jun 20, 2017

Same for me here on MacOS v1.13.1. Sometimes restarting VS Code helps. I haven't noticed this few months ago working on my projects. Now after I have returned from a short break, I see this all the time and it is annoying.

Dropbox history for index file is insane, it changes every few seconds and I'm not even touching the keyboard.
screen shot 2017-06-20 at 20 36 30

@simkessy
Copy link

simkessy commented Sep 5, 2017

Fixed, it stops when I close VSCode.

@JonCognioDigital
Copy link
Author

This thread has been open for a long time. Luckily it stopped happening to me a while ago but unfortunately I have no idea why.

@aqibos
Copy link

aqibos commented Sep 7, 2017

Yah, happening for me too 😢 Put my computer on "Do not disturb" to not get the Dropbox notifications constantly...

@justinrlee
Copy link

This just started occurring for me on OSX (10.12.6 Beta [16G12b)), VSCode 1.16.0, Dropbox v34.4.20.

Looks like it's touching .git/index every 6 seconds or so (unchanged lines removed):

$ while :; do sleep 1; ls -alhT index; done
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:27 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:34 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:37 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:44 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:48 2017 index

@leegrey
Copy link

leegrey commented Sep 19, 2017

This also just started happening for me also, On OSX 10.12.5 (16F73) / VS Code Version 1.16.1 / Dropbox v34.4.22

@JonCognioDigital
Copy link
Author

I have found a workaround.

I'm using Sublime Text instead until Microsoft fix it.

@simkessy
Copy link

Honestly, I just turn off notifications in Dropbox and I forgot about this problem.

@mileusna
Copy link

You might forgot about the problem, but your CPU and your laptop battery life are still aware of the problem. ;)

@thomcuddihy
Copy link

On High Sierra vanilla (10.13), Seafile Client 6.1.0, and VS Code 1.16.1 this issue(?) repeats, where a VS Code window editing a file will git fetch all git repositories in child directories. This causes a near constant stream of notifications of updated FETCH_HEADs in my sync client (seafile).

I use a question mark on the issue above, as are far as I can see, this is all expected behaviour: VS Code does auto-fetching, and sync clients, well, sync. A command line git fetch touches the FETCH_HEAD, so, if anything, it's an issue for git, not VS Code. Maybe VS Code could be updated to only auto fetch repositories that are directly opened in the editor, instead of all child directories (and if this is supposed to be the logic already, then we have a bug to fix).

If you're having this happen on your machine, consider either turning off notifications for your sync client (not really recommended), adding FETCH_HEAD to your sync client ignore filter (definitely not recommended), addressing which files you have open in VS Code and your directory structure (too much effort for me), or do as I did and disable the auto fetch feature using "git.autofetch": false in your settings.

@jackross
Copy link

I was seeing a similar problem -- Index constantly changing -- however I was using Atom editor, not VSCode. I finally fixed the problem by ensuring that all of my machines were using the same version of Git (I had three machines that were all on different versions). Now they are all on git 2.14.2 and the problem has disappeared. Just my 2 cents...

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests