Sublime Forum

Git diff not working for only one particular file in repo

#1

I have a bizarre problem I’ve been struggling with for a couple of days. Hoping someone might have some insight here.

I’m using ST 3211 and there is one particular file in my project repo that does not want to show mini diff changes in the gutter. The project is here:

And the file in question is

From a freshly cloned repo all other source files show the mini diff. However, geom.f90, which is rather large (43k lines) does not.

Any ideas on why one particular file would not show diffs? Thanks

0 Likes

#2

I suspect that it has something to do with the size of the file in question, although I’m not aware of any documented upper limit that’s ever been mentioned on the size of the files in question.

I can reproduce your issue on a fresh install (on Linux) in that repo. I also played a bit with the set_reference_document() API method, which tells Sublime what file content the diff should be calculated against.

If you use view.set_reference_document("hi") in the Sublime console, the mini_diff will appear and cover all lines of the file (since it thinks it used to be just the word hi).

However, view.set_reference_document(view.substr(sublime.Region(0, len(view)))) doesn’t work; it tells the diff that the reference document is the content of the file, and as soon as you do that the mini_diff stops displaying anything even on future changes.

It may be worth logging an issue at https://github.com/sublimehq/sublime_text/issues regarding this (unless there already is one).

0 Likes

#3

Thank you for taking a look at this! Just knowing the problem is not on my end is super helpful. I’ll check the Issue tracker and see about posting there.

0 Likes

#4

In case anyone else here runs into this problem, I submitted an issue and the swift reply was:

“Mini diffs are automatically disabled for any file with more than 1M characters for performance reasons”

1 Like