Sublime Forum

Random file deletion (unstaged changes)

#1

Hi,

Sometimes when I open SublimeMerge (or possibly, when switching repositories), I will suddenly have un-staged changes which amount to some random file having been deleted. I definitely did not actually delete the file, but SublimeMerge perceives that I did, and the file is missing in the filesystem.

Why might this be happening? Our local repo’s are all on network drives… Could that be related?

I realize I can just Discard the changes, but feel it’s probably better to NOT need to routinely prevent deletion of random files. Also, if this happens for others, it could really confuse newbies, as it did to me when I first encountered it, when I was still just beginning to understand git and SublimeMerge.

Any advice on how to prevent this from occurring is appreciated!

PS - thanks for the awesome Sublime products. SublimeText and Sublime Merge as very nice to use!

0 Likes

#2

I’ve seen deleted files in the worktree after switching branches or rebasing if git was not able to write the file for some reason - maybe because it’s locked by another process or whatever.

Example:

It used to happen with markdown files if the repo was open in Sublime Text as well. Each time git manipulated a markdown file in the working directory ST tried to pick up the changes and locked the file (for too long), which in turn may have caused git to fail to update it at some point. As a result the file was gone. But havn’t seen it with ST 3207 anymore.

Sublime Merge just reads files and the git database if I recall correctly. All manipulations are handled by calling the git executable.

0 Likes

#3

Hmm, thanks for the info… I don’t think it’s file locking, because, for instance, I just cliekd to discard a hunk change in the working dir, and suddenly SublimeMerge tells me I have 265 modified files, when in reality, it was 2 files.

Any other thoughts?

0 Likes

#4

Are you perhaps using a networked file system that does not support filesystem events (such as NFS)?

0 Likes