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

Add sort mode for branch parameter: most recently updated

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-parameter-plugin
    • None

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

          [JENKINS-37524] Add sort mode for branch parameter: most recently updated

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

          Regards
          Boguslaw

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

          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

          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

          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

          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

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

              Created:
              Updated: