Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Sort/order pull requests by merged date #1600

Open

Description

@OliverJAsh

It should be possible to sort/order pull requests by merged date. (I understand this only makes sense for merged PRs, not open/closed ones.)

Activity

  1. eouw0o83hf commented on Mar 18, 2020

    @eouw0o83hf

    This is a really severe gap in usability - every other online scm provider I've used provides this option by default.

    I really need this when sifting through recent PRs while troubleshooting production issues. This feature's absence has cost me a material amount of precious troubleshooting time.

    I know that searching provides a date filter, which is great when you have the time to re-learn how to use the search syntax. But, I should really easily be able to see the most recent merges into the codebase, in order, in order to drive down the time to identifying and correcting production bugs.

    As it stands, GitHub is actively getting in the way of that troubleshooting process and hurting me as a developer.

  2. KarneAsada commented on Jun 11, 2020

    @KarneAsada

    While we're at it, can we add the option to change the merged display to use a timestamp? Displaying "merged yesterday" is fairly useless when there are dozens of merges per day.

  3. Konamiman commented on Aug 13, 2020

    @Konamiman

    The following script sorts the pull requests by merge date, oldest first (reverse the localeCompare for newest first):

    var issues = document.getElementsByClassName("js-issue-row");
    var issuesArray = [].slice.call(issues);
    
    var sortedIssues = issuesArray.sort(function(a,b) {
        var timeA = a.getElementsByTagName("relative-time")[0].getAttribute("datetime");
        var timeB = b.getElementsByTagName("relative-time")[0].getAttribute("datetime");
        return timeA.localeCompare(timeB);
    });
    
    var issuesContainer = issues[0].parentElement;
    
    issuesContainer.innerHTML = "";
    for(var i=0; i<sortedIssues.length; i++) {
        issuesContainer.appendChild(sortedIssues[i]);
    }

    And the following one displays dates in timestamp format:

    var times = document.getElementsByTagName("relative-time");
    
    for(var i=0; i<times.length; i++) {
        var datetime = times[i].getAttribute("datetime");
        times[i].innerHTML = datetime.replace("T", " ").replace("Z", " ");
    };

    I guess those could be easily converted to TamperMonkey scripts or the like. The problem is that the page updates itself from time to time in order to keep the "human readable" timestamps updated, but at least the sorting is kept.

  4. lonewarrior556 commented on Aug 19, 2020

    @lonewarrior556

    Coming from tfs I honestly cannot believe this is not an option

  5. moltob commented on Apr 27, 2021

    @moltob

    Not really the full feature but a small workaround that might just show you the PR you were searching for is to order by updated date. So with a filter like this: is:pr is:merged sort:updated-desc.

    Or in GraphQL:

    {
      repository(owner:"<org>" name:"<repo>") {
        pullRequests(first:100 orderBy:{field:UPDATED_AT direction:DESC} states:MERGED) {
          pageInfo {
            hasNextPage
            endCursor
          }
          nodes {
            number
            title
            updatedAt
          }
        }
      }
    }
  6. K3UL commented on Apr 29, 2021

    @K3UL

    Unfortunately, the last updated is not really a good solution because it just needs any event to count as updated. It does not give an actual timeline of the PR going to a branch.
    For example we have a script that deletes stale branches that have been merged, and it adds an event to the PR, making it more recently updated.

  7. chrisclark commented on Jun 21, 2021

    @chrisclark

    Holy moly I think this feature actually exists! I was similarly baffled that this couldn't be done (...and still am), but then stumbled up the "Pulse" page:

    https://github.com/n8n-io/n8n/pulse

    It's not perfect because the date filtering is limited, but it will serve my purposes! Hope this helps someone else.

  8. fzngagan commented on Aug 22, 2021

    @fzngagan

    I've written a ruby script which uses https://github.com/octokit/octokit.rb to list the PRs merged into a branch sorted by the order they were merged into a given branch. Might help someone. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions