Issue #4779 new

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

Timwi
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 (33)

  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:

    https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit1>..<commit2>#commits
    

    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:

    https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit2>..<commit1>;

    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. Log in to comment