Hello, I tried different versions of SourceTree for Windows (3.4.30 and 3.4.23 an older one),
and I see that when I'm clicking on some *.ipynb file in git commit, I have a very slow processing it to show lines with code changes. And the whole app is hanging 1-2 min while diff is not shown.
--
Probably it's related to particular repository and corresponding git setttings:
https://github.com/lysukhin/vk-academy-dl-cv
--
Just a guess, maybe it's related to the fact repository created on Mac,
but I'm working with it on Windows, and also I have
core.autocrlf = true
Maybe it's all very slow because of different line endings. (external utility) DiffMerge also very slow in processing diff to ipynb files in that repository
Hey @Neznakomec ,
I'm not that familiar with Jupyter Notebooks, but it would probably depend on how large these JSON files are. From what I've found, .ipynb files often contain long, single-line strings of metadata and Sourcetree's diff engine probably attempts to process these as standard text. But then a single line or the raw diff data exceeds certain thresholds and the application can hang.
core.autocrlf = true > this should be correct (Git to convert LF to CRLF), but this can also force Sourcetree to calculate a diff for the entire file, rather than just the modified code. 🫤
What you could try (I've only found this and not tested it):
To prevent Sourcetree from attempting to render these complex diffs, tell Git to treat them as binary files.
Create or edit a
.gitattributesfile in your repository root.Add the line:
*.ipynb -diffThis will stop Sourcetree from hanging, as it will no longer try to generate a text-based diff for these files
Or you can try to use a specialized diff tool or optimize Git config. 👀
But this is a bit out of my 'domain' - potentially someone worked more with .ipynb files and could share some insights.
Cheers,
Tobi
Thank you Tobi, probably it's the best solution (to ignore ipynb files ONLY IN THAT repository)
Probably this particular repository had a problem
because of different (Windows and Mac) line endings or because IPYNB files shrinked to one-line JSON or smth like that...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad it helped! 😊
Yeah, in that case, ignoring only *.ipynb files in this repository sounds like the safest workaround. If you still need to compare notebook changes later, maybe a dedicated notebook diff tool would be a better option than relying on Sourcetree’s default diff view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.