1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #4779 new

Ability to diff between any two *commits* (not revisions of a single file) (BB-6045)

created an issue

In the list of commits (URL: /<username>/<projectname>/changesets), let’s have some UI to select any two commits and see a diff between them.

A possible UI might look like this: every commit has a little icon to its left which symbolises “diff”. When you click on one, it just gets depressed. Perhaps a message could show somewhere to invite you to click on another one. Once you click on a second one, the page reloads and a diff between the two commits is shown.

Comments (106)

  1. Roman Starkov

    I was quite surprised that the UI behind the "Compare" button doesn't accept two arbitrary revisions. It really should. Mercurial itself accepts revisions and branches interchangeably; so should the "Compare" UI.

  2. Timwi reporter

    Well, personally I feel the “Compare” UI is a usability dead-end. For it to be useful it would have to present the list of changesets as nicely and usefully as the “Commits” page does, so you might as well use the “Commits” page instead. If you only show the changeset date/time and description, users lose the ability to identify changesets by their relationship to other changelists.

  3. Tyler Collier

    I think I found it, they already have the ability.

    Here's an example URL:


    It worked great for me!

  4. Kevin Verre

    Hi, I would also like to voice my support for this feature.

    In git you can see the differences between two commits by doing "git diff commit1..commit2"

    In Bitbucket, there doesn't seem to be a way of doing this through the UI unless the commits are the last commits of two different branches, in which case you can diff the branches (if you think of it). Tyler provided a URL that allows us to see the git diff without getting to it through the UI:


    However, it should be noted that the order of the commit arguments is reverse when using this URL compared to using Git. For example, if Commit B was the commit directly after Commit A, then git diff A..B shows the contents of Commit B whereas git diff B..A shows what it takes to revert Commit B. Using this URL method allows to go from A..B if you submit B..A and doesn't allow you to see B..A.

  5. Tamás Barta

    Only if we had an open source alternative... Oh, wait, we have... GitLab does everything and more than Bitbucket, and does it much better (and faster). Tickets like this makes Bitbucket really-really unappealing. Same with no source code search... It's really time to do something about this! I already almost convinced my bosses to switch from our Bitbucket plan.

  6. Jean-Gabriel

    Gitlab has this feature, Github has it, every Git client has it... Forging the URL manually is doable but not very practical.

    Count me in on this feature request.

  7. Thomas Baynes

    I could be wrong, but I think we are already using this feature? Here is an example URL to try. Only works on commits within a single branch.


    We use this on our master branch to check for updated client content before publishing it. Here is what that looks like (diff between latest master commit to a specific previous commit):


  8. Avi Kehat


    You're sample is a "diff between latest master commit to a specific previous commit".

    What we want is a not to compare the "latest master commit". We want to compare any 2 specific previous commits.



  9. coyot linden

    As a fellow software engineer, I am completely mystified as to why a change that is so clearly wanted by the customers (65 comments) and so trivial to make (UI only change, no underlying or back end changes) has taken four years. For a company that makes program management tools, the irony is pretty fierce.

  10. Steve Peak

    Dmitry Belyaev I understand this is in the UI, but is there an API with json output available? Ex https://bitbucket.org/api/2.0/owner/repo/compare/base..head

  11. Dmitry Belyaev

    Steve Peak Let's see. Open a project in a browser with developer tools turned on and navigate to a comparison address such as https://bitbucket.org/atlassianlabs/atlassian-support/branches/compare/master%0D10-fetch-db-connection-info

    We see 3 GET requests:


    Apparently they use internal API for that. But who cares?

    We are not asking for API to write our tools. We want that "Compare" tool that is already present in the UI and works for tags, branches and commit hashes to ALLOW to choose those commit hashes.


  12. Claudio Galdiolo

    Hi bitbucket.org, this really useful request is not yet done after 4 years. The feature is already available, we just need a way to pick two commits to build the right URL. It's really a simple change, can I please program this for you for free?

  13. Lei Shi

    I'm surprised that this feature has been discussed for over 4 years, and not yet been implemented... Is this feature a "VIP" feature that only paid users have? If so, please let us know...

  14. Lei Shi

    OK, then this is sad... I may want to migrate to Github just because of this... I can see that my group will need this feature badly in the near future... Can't affort another 4-year wait...

  15. .mq.


    Yes, this is really basic thing which needs be available. I really do not understand why is it taking 4.5 years. Especially, when the feature already exists (see comments above) and all that needs to be done is to enable it in the UI.

  16. Claudio Galdiolo

    Hi Alastair Wilkes , the feature is already available, we just need a way to pick two commits to build the right URL. It's really a simple change, can I please program this for you for free? As Tyler Collier said 3 years ago we just need to build this URL:

  17. Alastair Wilkes staff

    Claudio Galdiolo and Alex Keeling LOL, thanks for the offers :)

    There is a surprising amount of magic™ going on under the hood in the compare page - a confluence of reasons makes this UX change not quite as simple of an update as it looks. Admittedly, it's not a huge project, but it actually requires rewriting a decent chunk of compare.

    In the first quarter of this year we've closed 4 of our top ten most highly voted issues (and the top one - search - is right around the corner); that doesn't help resolve this issue any faster, but I hope it shows that we are committed to getting these improvements out. Thanks for being patient.

  18. Log in to comment