{"thread":{"id":"34323","subject":"[Q] Getting the latest available Linux-kernel version (v3.x.y-stable or v3.x.y-rcX)?","startedAt":"2013-07-02T08:03:13Z","lastAt":"2013-07-02T11:19:29Z","messageCount":5,"participants":["Sedat Dilek","Ramkumar Ramachandra"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"222347","messageId":"CA+icZUV50bn4wjohfmKWL-GXpstidPNsNWqHuq+0gvEorWOaxA@mail.gmail.com","threadId":"34323","inReplyTo":null,"subject":"[Q] Getting the latest available Linux-kernel version (v3.x.y-stable or v3.x.y-rcX)?","fromName":"Sedat Dilek","fromEmail":"sedat.dilek@gmail.com","sentAt":"2013-07-02T08:03:13Z","receivedAt":"2013-07-02T08:03:13Z","isPatch":false,"sender":{"key":"sedat.dilek@gmail.com","avatar":null},"body":"Hi,\n\nfor my Linux-kernel build-script I am searching for a reliable check\nof getting the ***latest*** version.\nThis could be 'v3.x.y-stable' or 'v3.x.y-rcX'.\n\n'git tag' seems to be fast, but not reliable.\n'git log --oneline' is slow, but does the job.\n\nFor getting v3.x.y-stable this seems to work...\n\n$ git tag | grep ^'v3.[0-9]*' | grep -v '\\-rc' | sort --version-sort\nv3.0\nv3.1\nv3.2\nv3.3\nv3.4\nv3.5\nv3.6\nv3.7\nv3.8\nv3.9\nv3.10\n\n...but not when listing v3.x.y-rcX, too:\n\n$ git tag | grep ^'v3.[0-9]*' | sort --version-sort | grep ^'v3.10'\nv3.10\nv3.10-rc1\nv3.10-rc2\nv3.10-rc3\nv3.10-rc4\nv3.10-rc5\nv3.10-rc6\nv3.10-rc7\n\nI know that v3.10 > v3.10-rcX, but not 'git tag' or 'sort --version-sort' :-).\n\nThis seems from my poor sed/awk/grep skills to be the most reliable method...\n\n$ time git log --oneline v3.0-rc1.. | grep 'Linux 3.' | awk '{ print\n$3 }' | grep ^'3.[0-9]*' | head -1\n3.10\n\nreal    0m10.024s\nuser    0m5.611s\nsys     0m4.857s\n\n...but is slow (even I take v3.0-rc1 as the 1st version-tag of\nLinux-v3.x series).\n\nAny improvements?\n\nThanks in advance.\n\nRegards,\n- Sedat -\n"},{"id":"222352","messageId":"CALkWK0nj3BG0VCxkzack_9sHa8oo=aypuv6KRusdRKyO1JCkAw@mail.gmail.com","threadId":"34323","inReplyTo":"CA+icZUV50bn4wjohfmKWL-GXpstidPNsNWqHuq+0gvEorWOaxA@mail.gmail.com","subject":"Re: [Q] Getting the latest available Linux-kernel version (v3.x.y-stable or v3.x.y-rcX)?","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-07-02T08:46:10Z","receivedAt":"2013-07-02T08:46:10Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Sedat Dilek wrote:\n> for my Linux-kernel build-script I am searching for a reliable check\n> of getting the ***latest*** version.\n\n  $ git describe HEAD\n\nIf you want a sorted list of tags,\n\n  $ git for-each-ref --sort=taggerdate --format=\"%(refname:short)\" refs/tags\n\nAre you looking for something else?\n"},{"id":"222356","messageId":"CA+icZUUMjKx2J+Q4xKc6QkiSQB71szVjZNURhkpLFMGjqgpqRw@mail.gmail.com","threadId":"34323","inReplyTo":"CALkWK0nj3BG0VCxkzack_9sHa8oo=aypuv6KRusdRKyO1JCkAw@mail.gmail.com","subject":"Re: [Q] Getting the latest available Linux-kernel version (v3.x.y-stable or v3.x.y-rcX)?","fromName":"Sedat Dilek","fromEmail":"sedat.dilek@gmail.com","sentAt":"2013-07-02T09:05:55Z","receivedAt":"2013-07-02T09:05:55Z","isPatch":false,"sender":{"key":"sedat.dilek@gmail.com","avatar":null},"body":"On Tue, Jul 2, 2013 at 10:46 AM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Sedat Dilek wrote:\n>> for my Linux-kernel build-script I am searching for a reliable check\n>> of getting the ***latest*** version.\n>\n>   $ git describe HEAD\n>\n> If you want a sorted list of tags,\n>\n>   $ git for-each-ref --sort=taggerdate --format=\"%(refname:short)\" refs/tags\n>\n> Are you looking for something else?\n\nHi Ramukar,\n\nThanks for the quick answer!\n\nCool, this seems to keep version-chronology!\n\n$ git for-each-ref --sort=taggerdate --format=\"%(refname:short)\"\nrefs/tags | grep ^'v3.[0-9]*' | tail -1\nv3.10\n\n$ git for-each-ref --sort=taggerdate --format=\"%(refname:short)\"\nrefs/tags | grep ^'next-[0-9]*' | tail -1\nnext-20130702\n\nAnother question if I may ask:\n\nSometimes I need to bisect a previous Linux-Next version.\n\nWhat I am doing is to have the latest Linux-v3.x.y(-rcX) as stable base.\n\n$ git checkout upstream\n$ git checkout -b Linux-v3.10-rc7 v3.10-rc7\n\nAfterwards I checkout the latest Linux-Next remote repository with all\nits (new) tags (here: next-20130628)\n\n$ git checkout -b Linux-Next-v20130628\n$ git pull linux-next --tags next-20130628\n\nHow do I get the latest available linux-version in the downgraded\n(current) Linux-Next local repository (example: I have parallelly\nLinux-Next-v20130702 and Linux-Next-v20130628)?\nIf I have all -next tags merged-in, I will get always today's 'next-20130702'.\nDue to my poor git skillz I do this manually for git-bisect sessions.\n\nThanks again, you helped me a lot with the above!\n\n- Sedat -\n"},{"id":"222366","messageId":"CALkWK0mm4iB5Z2t0n7vBkfUNTPR-e0bU7D_V+4DXXEvrNj6R4w@mail.gmail.com","threadId":"34323","inReplyTo":"CA+icZUUMjKx2J+Q4xKc6QkiSQB71szVjZNURhkpLFMGjqgpqRw@mail.gmail.com","subject":"Re: [Q] Getting the latest available Linux-kernel version (v3.x.y-stable or v3.x.y-rcX)?","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-07-02T11:06:31Z","receivedAt":"2013-07-02T11:06:31Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Sedat Dilek wrote:\n> Sometimes I need to bisect a previous Linux-Next version.\n>\n> What I am doing is to have the latest Linux-v3.x.y(-rcX) as stable base.\n>\n> $ git checkout upstream\n> $ git checkout -b Linux-v3.10-rc7 v3.10-rc7\n>\n> Afterwards I checkout the latest Linux-Next remote repository with all\n> its (new) tags (here: next-20130628)\n>\n> $ git checkout -b Linux-Next-v20130628\n> $ git pull linux-next --tags next-20130628\n>\n> How do I get the latest available linux-version in the downgraded\n> (current) Linux-Next local repository (example: I have parallelly\n> Linux-Next-v20130702 and Linux-Next-v20130628)?\n\nI'm not able to understand the question.  I'm not sure why you're\ncreating branches from existing tags.  You can easily do:\n\n  $ git bisect start @ v3.10-rc7\n\n(@ is a synonym for HEAD in the latest git)\n\nYou can also fetch all tags:\n\n  $ git fetch --tags\n\nand decide what to do with them later:\n\n  $ git merge next-20130628\n\nIn the process, next-20130628 hasn't changed: you can still use it as a\nbisect endpoint.\n\n> If I have all -next tags merged-in, I will get always today's 'next-20130702'.\n> Due to my poor git skillz I do this manually for git-bisect sessions.\n\n*scratches head*\n\nCan you try rephrasing your question?\n"},{"id":"222367","messageId":"CA+icZUU8sA7L_a1sMEqhUXZbzuG5BKRf_NkZSrW_3im1hjRAKg@mail.gmail.com","threadId":"34323","inReplyTo":"CALkWK0mm4iB5Z2t0n7vBkfUNTPR-e0bU7D_V+4DXXEvrNj6R4w@mail.gmail.com","subject":"Re: [Q] Getting the latest available Linux-kernel version (v3.x.y-stable or v3.x.y-rcX)?","fromName":"Sedat Dilek","fromEmail":"sedat.dilek@gmail.com","sentAt":"2013-07-02T11:19:29Z","receivedAt":"2013-07-02T11:19:29Z","isPatch":false,"sender":{"key":"sedat.dilek@gmail.com","avatar":null},"body":"On Tue, Jul 2, 2013 at 1:06 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> Sedat Dilek wrote:\n>> Sometimes I need to bisect a previous Linux-Next version.\n>>\n>> What I am doing is to have the latest Linux-v3.x.y(-rcX) as stable base.\n>>\n>> $ git checkout upstream\n>> $ git checkout -b Linux-v3.10-rc7 v3.10-rc7\n>>\n>> Afterwards I checkout the latest Linux-Next remote repository with all\n>> its (new) tags (here: next-20130628)\n>>\n>> $ git checkout -b Linux-Next-v20130628\n>> $ git pull linux-next --tags next-20130628\n>>\n>> How do I get the latest available linux-version in the downgraded\n>> (current) Linux-Next local repository (example: I have parallelly\n>> Linux-Next-v20130702 and Linux-Next-v20130628)?\n>\n> I'm not able to understand the question.  I'm not sure why you're\n> creating branches from existing tags.  You can easily do:\n>\n>   $ git bisect start @ v3.10-rc7\n>\n> (@ is a synonym for HEAD in the latest git)\n>\n> You can also fetch all tags:\n>\n>   $ git fetch --tags\n>\n> and decide what to do with them later:\n>\n>   $ git merge next-20130628\n>\n> In the process, next-20130628 hasn't changed: you can still use it as a\n> bisect endpoint.\n>\n>> If I have all -next tags merged-in, I will get always today's 'next-20130702'.\n>> Due to my poor git skillz I do this manually for git-bisect sessions.\n>\n> *scratches head*\n>\n> Can you try rephrasing your question?\n\nOK, I will try.\n\nThe base for my local Linux development GIT repository is the one from\nLinus (aka upstream/mainline).\nThere-in I pull diverse Linux-next releases where I take its latest\nLinux-upstream version as the new base.\n\nEXAMPLES:\n\n1. next-20130628 has its base as v3.10-rc7\n2. next-20130702 has its base as v3.10\n\nI am using always the version-tags for switching to a new local repo.\n\nAs said above I switch to the latest Linux-upstream version of the\ncorresponding -next and then pull in via '--tags' (see above).\n\nLet's say I am on today's next-20130702 and switch back to my local\nnext-20130628 tree, the lastest version-tag available is always\n'next-20130702'.\n\nIt could be my workflow is somewhere wrong.\n\nHope this is a bit enlightening.\n\nRegards,\n- Sedat -\n"}]}