Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to provide custom diff views for specific file types?

Jamey Holden
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 7, 2016

Hi, I have a few binary files which obviously by default don't show a diff view (instead it just says 'Binary file modified.'). However, while these files need to be in binary form in source control, I have some code which can read the files and show a more useful text representation, which could then provide a useful diff view.

I would like to create an add-on which can provide its own diff view for these files when viewing a pull request. Is it possible to achieve what I want with Atlassian Connect (bitbucket-connect)? The most relevant thing I can see in the documentation is the web items module, which has an org.bitbucket.pullrequest.summary.info location, but I can't find any reference to this in the html and it's not clear what part of the page this would actually link to...

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 7, 2016

Hi Jamey,

You can't currently override the diff view, but you can override the source view using the File View add-on module. It wouldn't change the view on the pull request, but your users would be able to click the "View File" link for the binary file on the pull request to view the textual representation of the binary. 

Long term, it might be best to raise a feature request detailing your use-case and requesting a diff extension point. Bitbucket Server has one, so it's definitely a possibility. 

As an alternative, you could add use that web-item to link off to a custom diff view on a different page, but the the link is rendered per pull request, rather than per file. org.bitbucket.pullrequest.summary.info is rendered in the top right:

Pull request #5: Another branch — Bitbucket 2016-09-08 09-06-03.png

You can use the Location, Location, Location to discover other supported web-item locations if you like.

Hope this helps!

cheers,

Tim

Jamey Holden
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 7, 2016

Hi Tim, thanks for your reply. I'm going to raise a feature request and see what they say.

Also, thanks for the link to the location, location, location add-on. That's a great way to understand what locations do, I'm surprised it's not somewhere obvious in the documentation..

Seppe Stas July 21, 2018

Hey @Jamey Holden

 

~~I'm also really interested in this feature. Could you tell me where you raised this feature request?~~

After some more searching I found the feature request here: https://bitbucket.org/site/master/issues/13269/add-an-extension-point-for-the-pull

TAGS
AUG Leaders

Atlassian Community Events