Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37524

Add sort mode for branch parameter: most recently updated

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Please consider adding a sort mode which could be used with the branch parameter allowing sorting branches by when the branch was last updated.

        Attachments

          Activity

          Hide
          klimas7 Boguslaw Klimas added a comment -

          HI George Sakhnovsky
          Could you add some more information about this feature.
          Add some example or git command.

          Regards
          Boguslaw

          Show
          klimas7 Boguslaw Klimas added a comment - HI George Sakhnovsky Could you add some more information about this feature. Add some example or git command. Regards Boguslaw
          Hide
          gsakhnovsky George Sakhnovsky added a comment -

          if git_version >= 2.7.0:
          git branch --sort=-committerdate

          else:
          git for-each-ref --sort=-committerdate refs/heads/

          I got the above from the top answer to this StackOverflow question:

          http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit

          Show
          gsakhnovsky George Sakhnovsky added a comment - if git_version >= 2.7.0: git branch --sort=-committerdate else: git for-each-ref --sort=-committerdate refs/heads/ I got the above from the top answer to this StackOverflow question: http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
          Hide
          klimas7 Boguslaw Klimas added a comment - - edited

          The plugin does not use native git commands but it uses the API defined in the interface GitClient
          Currently this API does not allowed sorting via "--sort=-taggerdate".
          Additionally in version 0.8.0 I’ve switched from operating on updating repository to ls-remote commend (I use method getRemoteReferences from API) when getting tags or branch.
          JENKINS-40232

          Clone JENKINS-42073

          Regards
          Boguslaw

          Show
          klimas7 Boguslaw Klimas added a comment - - edited The plugin does not use native git commands but it uses the API defined in the interface GitClient Currently this API does not allowed sorting via "--sort=-taggerdate". Additionally in version 0.8.0 I’ve switched from operating on updating repository to ls-remote commend (I use method getRemoteReferences from API) when getting tags or branch. JENKINS-40232 Clone JENKINS-42073 Regards Boguslaw

            People

            Assignee:
            klimas7 Boguslaw Klimas
            Reporter:
            gsakhnovsky George Sakhnovsky
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: