{"thread":{"id":"48199","subject":"[PATCH 2/2] ls-remote: create option to sort by versions","startedAt":"2018-04-02T03:23:25Z","lastAt":"2018-04-02T03:23:25Z","messageCount":1,"participants":["Harald Nordgren"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"343567","messageId":"20180402032300.85020-1-haraldnordgren@gmail.com","threadId":"48199","inReplyTo":null,"subject":"[PATCH 2/2] ls-remote: create option to sort by versions","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2018-04-02T03:23:00Z","receivedAt":"2018-04-02T03:23:25Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"Updating tests and documentation\n\nSigned-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n---\n Documentation/git-ls-remote.txt |  5 +++++\n t/t5512-ls-remote.sh            | 19 ++++++++++++++++++-\n 2 files changed, 23 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt\nindex 5f2628c8f..81c518a90 100644\n--- a/Documentation/git-ls-remote.txt\n+++ b/Documentation/git-ls-remote.txt\n@@ -30,6 +30,11 @@ OPTIONS\n \tboth, references stored in refs/heads and refs/tags are\n \tdisplayed.\n \n+-V::\n+--version-sort::\n+\tSort ref names by version semantics, so that refs/tags/v1.2 is sorted\n+\tbefore refs/tags/v1.10.\n+\n --refs::\n \tDo not show peeled tags or pseudorefs like HEAD\tin the output.\n \ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex 02106c922..680a31223 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -10,6 +10,9 @@ test_expect_success setup '\n \ttest_tick &&\n \tgit commit -m initial &&\n \tgit tag mark &&\n+\tgit tag mark1.1 &&\n+\tgit tag mark1.2 &&\n+\tgit tag mark1.10 &&\n \tgit show-ref --tags -d | sed -e \"s/ /\t/\" >expected.tag &&\n \t(\n \t\techo \"$(git rev-parse HEAD)\tHEAD\"\n@@ -39,6 +42,17 @@ test_expect_success 'ls-remote self' '\n \ttest_cmp expected.all actual\n '\n \n+test_expect_success 'ls-remote --version-sort --tags self' '\n+\tcat >expect <<-\\EOF &&\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark1.1\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark1.2\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark1.10\n+\tEOF\n+\tgit ls-remote --version-sort --tags self >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'dies when no remote specified and no default remotes found' '\n \ttest_must_fail git ls-remote\n '\n@@ -131,7 +145,7 @@ test_expect_success 'Report no-match with --exit-code' '\n \n test_expect_success 'Report match with --exit-code' '\n \tgit ls-remote --exit-code other.git \"refs/tags/*\" >actual &&\n-\tgit ls-remote . tags/mark >expect &&\n+\tgit ls-remote . tags/mark* >expect &&\n \ttest_cmp expect actual\n '\n \n@@ -178,6 +192,9 @@ test_expect_success 'ls-remote --symref' '\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/remotes/origin/HEAD\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/remotes/origin/master\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark1.1\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark1.10\n+\t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/tags/mark1.2\n \tEOF\n \tgit ls-remote --symref >actual &&\n \ttest_cmp expect actual\n-- \n2.14.3 (Apple Git-98)\n\n"}]}