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

sort tags by natural numbers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-parameter-plugin
    • None

      Hello guys!

      Would be great if you can add natural sorting. Currently sorting tags digits looks like this:

      refs/tags/ver-2.2.0
      refs/tags/ver-2.2.1
      refs/tags/ver-2.2.10
      refs/tags/ver-2.2.11
      refs/tags/ver-2.2.12
      refs/tags/ver-2.2.13
      refs/tags/ver-2.2.14
      refs/tags/ver-2.2.15
      refs/tags/ver-2.2.16
      refs/tags/ver-2.2.17
      refs/tags/ver-2.2.18
      refs/tags/ver-2.2.19
      refs/tags/ver-2.2.2
      refs/tags/ver-2.2.20
      refs/tags/ver-2.2.21
      refs/tags/ver-2.2.3
      

      as you guess its confusing a bit

      expected output:

      refs/tags/ver-2.2.3
      refs/tags/ver-2.2.4
      refs/tags/ver-2.2.5
      refs/tags/ver-2.2.6
      refs/tags/ver-2.2.7
      refs/tags/ver-2.2.8
      refs/tags/ver-2.2.9
      refs/tags/ver-2.2.10
      refs/tags/ver-2.2.11
      refs/tags/ver-2.2.12
      refs/tags/ver-2.2.13
      refs/tags/ver-2.2.14
      refs/tags/ver-2.2.15
      refs/tags/ver-2.2.16
      refs/tags/ver-2.2.17
      refs/tags/ver-2.2.18
      refs/tags/ver-2.2.19
      

      Usefull command:

      git ls-remote -t <repository> "$tagFilter". | sort -t '/' -k 3 -V
      

      The best option would be sort by create tag date (git tag --sort=-creatordate), but I dont know git ls-remote allows his possibility.

            klimas7 Boguslaw Klimas
            rafalll r s
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: