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

Issues

Issue #8711 open

Allow sorting of the Pull Request list by column other than last updated (BB-9817)

Bitbucket Bot
created an issue

As the title states. Allow sorting by things other than the current forced order of last updated. This could be PR number, open date or even author.

Comments (14)

  1. Victor Yap

    One "workaround" for this is, simply going to the "branches" page. There, pull requests are sorted by branch. You'll be missing the columns for pull request statistics, but, at least the items won't constantly re-order themselves in a madly chaotic dance.

  2. Victor Yap

    ಠ ̨ರೃ —「JavaScript, JavaScript. Does whatever a JavaScript does. Can it swing from a web? No, it can't, it's a JavaScript.」

    $(document).ready(function(){
        document.bitbucket_augment = {
            sort_pull_requests_by_title: function(){
                var rows = $("table.pullrequest-list tbody tr");
                rows.remove()
                sorted = rows.sort(function(a,b){
                    var a_txt = $(a).find(".title div a").text().substring(6);
                    var b_txt = $(b).find(".title div a").text().substring(6);
                    return a_txt > b_txt;
                });
                sorted.each(function(i, elem){
                    $("table.pullrequest-list tbody").append(elem);
                });
            }
        };
        var filter_control = $("ul.filter-control")
        if(filter_control){
            filter_control.append('<li><a href="#sort_by_title" onclick="document.bitbucket_augment.sort_pull_requests_by_title(); return false;">Sort By Title</a></li>');
        }
    });
    

    There, I fixed it.

    The above JavaScript can also be injected using brower extensions, such as "Custom JavaScript for Websites" for Chrome.

  3. Adam Steiner

    We often have Pull requests from branches that include commits from other branches (that are also in pull requests).

    Sorting by PR number would make it easier for us to tackle reviews in order, so that we're not reviewing the same code twice.

  4. Victor Yap

    I believe that BitBucket's site structure changed since I wrote that JavaScript, thus breaking its functionality. At least the status changed to "open" today so maybe we'll see a permanent solution in the near future!

  5. Log in to comment