Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I'm experiencing this problem with .sql files: I can view the source but when I look at commit details I get the message "This file cannot be rendered in your browser" and if I click on "Diff to previous" I get an endless spinning loading gif.
One strange thing is that while viewing the source, the first character of the first row is a little red dot.
If I move the mouse on the red dot there's a tooltip saying "\uteff"
Is someone experiencing the same problem?
We are using Stash 3.5 64bit on Centos 7
One of the reasons you're seeing issues with the diff is that your SQL files contain a Byte Order Mark (BOM), this is the 0xFEFF sequence you're seeing at the start of the file. Unfortunately these bytes means git treats the file as binary, not text, and so any operations that depend on git, such as generating a diff, aren't going to return what you expect.
You would also see this behaviour if you did a git diff
on some commits in your repo from the command line, as Stash calls out to git for all it's operations:
Binary files a/file.sql and b/file.sql differ
In order for git to properly diff your SQL files you would need to ensure they're saved without the BOM byte, or you could use a git filter to ensure the BOM gets stripped when you commit the file.
As for the issue with "Diff to previous" - that's a real bug in Stash 3.5 with binary files in the source view, I have raised STASH-6866 to track this.
I you are right! After removing the BOM from one of the SQL and commiting several modifications I can use the source comparison. Thank you very much for your help. :-) Now I must find a way to apply a git filter as you suggested. let's got o study. :-) Thank you again. Alessandro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What if the BOM is required for build purposes? I tried using .gitattributes to make git treat UTF-16 xml files as text, but they still won't show a diff in the Bitbucket diff despite being able to be displayed in a git diff.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to resolve the issue by checking "Transcode Diffs". This resolved the issue with comparing sql files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ryanvgates Thanks! Your answer is the correct one. No one can go around and remove BOM from the existing files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dare I say ... this is the "BOM"!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked like a charm! Thanks @Ryan Gates
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Done, thank you. I opened the ticket number SSP-6608
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Reviewing SSP-6608, I see that the problem was resolved after removing the BOM at the beginning of the file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would it be possible for you to open a support ticket at https://support.atlassian.com/ and attach an example of a file that exhibits this behaviour so that we can try and reproduce the issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any kind of SQL files in particular, or all SQL files? That is, are they large, small, what SQL dialect are they? Stash 3.5 introduced changes to syntax highlighting in the file view, so trying to work out what in particular is causing this.
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.