Crucible Not Allowing Diffs For non text/plain Mime Types for .SQL files

AJ Mieskolainen December 5, 2018

So, it appears that SMSS is likely giving some of our .sql files a binary mime type.

This causes problems when adding .sql files to code reviews, as the code reviewer cannot use Crucible to see the changes. The code reviewer is forced to use source control to see the differences.

Updating all of the affected .sql files is not an option.

Is it possible to configure Crucible to treat .sql files as text regardless of mime-type?

1 answer

1 accepted

0 votes
Answer accepted
Ben Stuart
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2019

Hey AJ, this could be caused for a few different reasons. Do the SQL files show as loading forever or are they displayed as binary? 

It could be a performance problem:

We do allow for diffs between SQL files but there are some improvements on the performance of this in later versions. Ususally slow diff load are related to the following two bugs/ improvement requests:

  1. https://jira.atlassian.com/browse/CRUC-6593
  2. https://jira.atlassian.com/browse/CRUC-7050

The Store Diff Info would probably speed up showing diff's. You should be aware of the ramifications of setting this value as stated in the Documentation.

The issue could also be due to encloding:

Files that you are unable to view/diff could be encoded with: UNICODE

Files that you can view/diff may be encoded with: ASCII

Here is the only possible way I see to fixed this issue with in Fisheye. I am not sure this will work or fits your situation. I suggest testing this in a test environment with a test repo: Configuring a Different Charset in Fisheye/Crucible

Other than that there does not seem to be away with in Fisheye:
Fisheye uses the following file to handle file extensions: <FishEye/Crucible installation directory>/raw-mime.types
The following line within that file is where we map the extensions to be a text file:

text/plain   asc txt java jsp asp cs idl cpp cxx c h  pl pod py sh awk sed sql jspf tag 

SLQ is already consider to be a text file. So it really comes down to encoding I believe.

As you probably already know you can open a file in notepad and then do "Save As" and change the encoding.

I have been looking for a way to bulk convert the encode and I did fine something to at least identify the encoding. Also I am not sure what types of Repos we are dealing with. If you have git installed you can use the file command to list the encoding of each file.

Get encoding of a file in Windows - Stack Overflow

I found the following on how to bulk convert: How to bulk convert unicode file names to Ascii file names windows CMD or powershell - Stack Overflow

Having said all this if all your users change there editor to use ASCII by default when saving the file. Each time edit a file Checkout and Commit, that files head version will be fixed and viewable in Fisheye.

I hope this helps! 

Suggest an answer

Log in or Sign up to answer