Versions
- 9.5
- 9.4
- 9.3
- 9.2
- 9.1
- 9.0
- 8.19
- 8.18
- 8.17
- 8.16
- 8.15
- 8.14
- 8.13
- 8.12
- 8.11
- 8.10
- 8.9
- 8.8
- 8.7
- 8.6
- 8.5
- 8.4
- 8.3
- 8.2
- 8.1
- 8.0
- 7.21
- 7.20
- 7.18
- 7.19
- 7.17
- 7.16
- 7.15
- 7.14
- 7.13
- 7.12
- 7.11
- 7.10
- 7.9
- 7.8
- 7.7
- 7.6
- 7.5
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- 6.10
- 6.9
- 6.8
- 6.7
- 6.6
- 6.5
- 6.4
- 6.3
- 6.2
- 6.1
- 6.0
- 5.16
- 5.15
- 5.14
- 5.13
- 5.12
- 5.11
- 5.10
- 5.9
- 5.8
- 5.7
- 5.6
- 5.5
- 5.4
- 5.3
- 5.2
- 5.1
- 5.0
- 4.14
- 4.13
- 4.12
- 4.11
- 4.10
- 4.9
- 4.8
- 4.7
- See all
Using diff transcoding in Bitbucket Server
Advanced actions
- Running the Bitbucket Server installer
- Automated setup for Bitbucket Server
- Starting and stopping Bitbucket Server
- Install Bitbucket Server from an archive file
- Install and configure a remote Elasticsearch instance
- Running Bitbucket Server as a Linux service
- Running Bitbucket Server as a Windows service
- Bitbucket Server config properties
- Proxying and securing Bitbucket Server
- Enabling SSH access to Git repositories in Bitbucket Server
- Using diff transcoding in Bitbucket Server
- Changing the port that Bitbucket Server listens on
- Moving Bitbucket Server to a different context path
- Running Bitbucket Server with a dedicated user
- Bitbucket Server debug logging
- Data recovery and backups
- Lockout recovery process
- Scaling Bitbucket Server
- High availability for Bitbucket Server
- Clustering with Bitbucket Data Center
- Enabling JMX counters for performance monitoring
- Getting started with Bitbucket Server and AWS
- Disabling HTTP(S) access to Git repositories in Bitbucket Server
- Smart Mirroring
- Git Large File Storage
On this page
Related content
- Running Bitbucket Server as a Windows service
- Running the Bitbucket Server installer
- Starting Bitbucket Server/Data Center with service script after upgrade using archive file starts older version
- Supported platforms details
- Automated setup for Bitbucket Server
- Running Bitbucket Server with a dedicated user
- Starting and stopping Bitbucket Server
- Using the Bitbucket Server Backup Client
- Administering Bitbucket Server in AWS
- Integrating Bitbucket Server with Apache HTTP Server
As of Bitbucket Server 3.1, Bitbucket Server supports transcoding for diffs. This allows Bitbucket Server to convert files in encodings like EUC-JP, GB18030 and UTF-16 to UTF-8, so they are processed correctly by git diff
, which only supports UTF-8. Similar transcoding has been applied to Bitbucket Server's source view since it was released, so this change brings the diff view in line with the source view. Diff transcoding is applied to commit and pull request diffs, as well as the diff-to-previous view.
Git for Windows, formerly known as msysgit, has known issues with Unicode paths. Diff transcoding works on all supported versions of Git for Windows, but 1.8.0 or higher is required to support Unicode paths.
Enabling diff transcoding
Diff transcoding must be explicitly enabled for each repository (unlike source view transcoding, which is always performed).
Repository administrators can enable diff transcoding on the repository settings page:
Performance and scaling
There's a performance consideration with transcoding. It is implemented using Git's textconv
support, so using it adds overhead to displaying diffs. Where possible, the best approach, given git
only supports UTF-8 content, is to use UTF-8 encoding so that transcoding is not necessary. In repositories without non-UTF-8 content, diff transcoding should be left disabled. Other encodings are often a necessity, however, and for repositories containing such content enabling diff transcoding allows using the full range of Bitbucket Server features.
When transcoding is enabled, git diff
writes the before and after blobs to temporary files and invokes the textconv
script once for each file. The script Bitbucket Server installs uses Perl to send a request back to Bitbucket Server with the path to each temporary file. Bitbucket Server then opens each file, detects the encoding using the same algorithm the source view uses, converts the file to UTF-8 and streams it out for git diff
to use. After git diff
has invoked the textconv
script the temporary files it created are deleted.
Writing the blobs to disk, starting Perl and calling back into Bitbucket Server are all overhead processing compared to performing a diff without transcoding. How much overhead that is varies by the size of the diff. When nominally-sized files containing two or three thousand lines or less are being compared the overhead is miniscule, under 50 milliseconds on an average server. However, when comparing larger files the overhead can result in a noticeable delay displaying the diff.
Related content
- Running Bitbucket Server as a Windows service
- Running the Bitbucket Server installer
- Starting Bitbucket Server/Data Center with service script after upgrade using archive file starts older version
- Supported platforms details
- Automated setup for Bitbucket Server
- Running Bitbucket Server with a dedicated user
- Starting and stopping Bitbucket Server
- Using the Bitbucket Server Backup Client
- Administering Bitbucket Server in AWS
- Integrating Bitbucket Server with Apache HTTP Server