{"thread":{"id":"56679","subject":"I just want the revision","startedAt":"2021-10-11T02:52:23Z","lastAt":"2021-10-12T01:03:49Z","messageCount":10,"participants":["ToddAndMargo","Christian Couder","Daniel Knittl-Frank","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"438437","messageId":"e257c62e-edff-f559-95e7-374b623a3f61@zoho.com","threadId":"56679","inReplyTo":null,"subject":"I just want the revision","fromName":"ToddAndMargo","fromEmail":"toddandmargo@zoho.com","sentAt":"2021-10-11T02:37:12Z","receivedAt":"2021-10-11T02:52:23Z","isPatch":false,"sender":{"key":"toddandmargo@zoho.com","avatar":null},"body":"Hi All,\n\nI am trying to write a script to tell me the latest revision\nshowing on\n\nhttps://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n\nwhich is 'virtio-win: rebase on 0.164\", but I can only see this\nfrom a web browser, as the page is dynamic.\n\nI do have access to the git link on that page:\n\nhttps://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n\nDoes git (or some other) have a way of telling me\nJUST the revision without having to download the turkey?\n\nIf I could get something that contained\n        virtio-win: rebase on 0.164\nI could dig out the revision\n\nMany thanks,\n-T\n\n\n\n"},{"id":"438448","messageId":"CAP8UFD1_2g84epP+qjP2QW2g2bzdWcepPE60rY2vdKpTZFdEDg@mail.gmail.com","threadId":"56679","inReplyTo":"e257c62e-edff-f559-95e7-374b623a3f61@zoho.com","subject":"Re: I just want the revision","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2021-10-11T09:45:43Z","receivedAt":"2021-10-11T09:45:58Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n>\n> Hi All,\n>\n> I am trying to write a script to tell me the latest revision\n> showing on\n>\n> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n>\n> which is 'virtio-win: rebase on 0.164\", but I can only see this\n> from a web browser, as the page is dynamic.\n>\n> I do have access to the git link on that page:\n>\n> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n>\n> Does git (or some other) have a way of telling me\n> JUST the revision without having to download the turkey?\n\nIf you just want the commit ID, you can use for example:\n\n$ git ls-remote\nhttps://gitlab.freedesktop.org/spice/win32/spice-nsis.git\nrefs/heads/master\nf6ad44f35f5caeec51b7002169977272d85701a3        refs/heads/master\n\n> If I could get something that contained\n>         virtio-win: rebase on 0.164\n> I could dig out the revision\n\nYou might also want to take a look at the GitLab API docs, for example:\n\nhttps://docs.gitlab.com/ee/api/commits.html\n\nBest,\nChristian.\n"},{"id":"438449","messageId":"a12adb98-d8c1-cd36-1760-343360a9ba85@zoho.com","threadId":"56679","inReplyTo":"CAP8UFD1_2g84epP+qjP2QW2g2bzdWcepPE60rY2vdKpTZFdEDg@mail.gmail.com","subject":"Re: I just want the revision","fromName":"ToddAndMargo","fromEmail":"toddandmargo@zoho.com","sentAt":"2021-10-11T10:09:39Z","receivedAt":"2021-10-11T10:09:48Z","isPatch":false,"sender":{"key":"toddandmargo@zoho.com","avatar":null},"body":"On 10/11/21 02:45, Christian Couder wrote:\n> Hi,\n> \n> On Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n>>\n>> Hi All,\n>>\n>> I am trying to write a script to tell me the latest revision\n>> showing on\n>>\n>> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n>>\n>> which is 'virtio-win: rebase on 0.164\", but I can only see this\n>> from a web browser, as the page is dynamic.\n>>\n>> I do have access to the git link on that page:\n>>\n>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n>>\n>> Does git (or some other) have a way of telling me\n>> JUST the revision without having to download the turkey?\n> \n> If you just want the commit ID, you can use for example:\n> \n> $ git ls-remote\n> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> refs/heads/master\n> f6ad44f35f5caeec51b7002169977272d85701a3        refs/heads/master\n> \n>> If I could get something that contained\n>>          virtio-win: rebase on 0.164\n>> I could dig out the revision\n> \n> You might also want to take a look at the GitLab API docs, for example:\n> \n> https://docs.gitlab.com/ee/api/commits.html\n> \n> Best,\n> Christian.\n> \n\nHi Christian,\n\nI do not mean to be dense, but how do I get\n\"virtio-win: rebase on 0.164\" out of:\n\" f6ad44f35f5caeec51b7002169977272d85701a3  refs/heads/master\"?\n\nPerplexed,\n-T\n"},{"id":"438450","messageId":"afd8890e-0042-8fc6-523d-f69aa6ed7af3@zoho.com","threadId":"56679","inReplyTo":"a12adb98-d8c1-cd36-1760-343360a9ba85@zoho.com","subject":"Re: I just want the revision","fromName":"ToddAndMargo","fromEmail":"toddandmargo@zoho.com","sentAt":"2021-10-11T10:24:40Z","receivedAt":"2021-10-11T10:24:50Z","isPatch":false,"sender":{"key":"toddandmargo@zoho.com","avatar":null},"body":"On 10/11/21 03:09, ToddAndMargo wrote:\n> On 10/11/21 02:45, Christian Couder wrote:\n>> Hi,\n>>\n>> On Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo <ToddAndMargo@zoho.com> \n>> wrote:\n>>>\n>>> Hi All,\n>>>\n>>> I am trying to write a script to tell me the latest revision\n>>> showing on\n>>>\n>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n>>>\n>>> which is 'virtio-win: rebase on 0.164\", but I can only see this\n>>> from a web browser, as the page is dynamic.\n>>>\n>>> I do have access to the git link on that page:\n>>>\n>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n>>>\n>>> Does git (or some other) have a way of telling me\n>>> JUST the revision without having to download the turkey?\n>>\n>> If you just want the commit ID, you can use for example:\n>>\n>> $ git ls-remote\n>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n>> refs/heads/master\n>> f6ad44f35f5caeec51b7002169977272d85701a3        refs/heads/master\n>>\n>>> If I could get something that contained\n>>>          virtio-win: rebase on 0.164\n>>> I could dig out the revision\n>>\n>> You might also want to take a look at the GitLab API docs, for example:\n>>\n>> https://docs.gitlab.com/ee/api/commits.html\n>>\n>> Best,\n>> Christian.\n>>\n> \n> Hi Christian,\n> \n> I do not mean to be dense, but how do I get\n> \"virtio-win: rebase on 0.164\" out of:\n> \" f6ad44f35f5caeec51b7002169977272d85701a3  refs/heads/master\"?\n> \n> Perplexed,\n> -T\n\n\nFound something that worked:\n\n$ curl --silent \n'https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/commits/master' \n| grep  rebase\n\n<a class=\"commit-row-message item-title js-onboarding-commit-item \" \nhref=\"/spice/win32/spice-nsis/-/commit/f6ad44f35f5caeec51b7002169977272d85701a3\">virtio-win: \nrebase on 0.164</a>\n\n<a class=\"commit-row-message item-title js-onboarding-commit-item \" \nhref=\"/spice/win32/spice-nsis/-/commit/d6836f79ba8deeef5b7719fd94cc208b81eb70df\">virtio-win: \nrebase on 0.164</a>\n\n\n"},{"id":"438460","messageId":"CAP8UFD0TBOkNU2g_OqpMiQyopBfae95nBwJQJ8F04+C1FcBRYQ@mail.gmail.com","threadId":"56679","inReplyTo":"afd8890e-0042-8fc6-523d-f69aa6ed7af3@zoho.com","subject":"Re: I just want the revision","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2021-10-11T13:13:44Z","receivedAt":"2021-10-11T13:13:59Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Oct 11, 2021 at 12:24 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n>\n> On 10/11/21 03:09, ToddAndMargo wrote:\n> > On 10/11/21 02:45, Christian Couder wrote:\n> >> Hi,\n> >>\n> >> On Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo <ToddAndMargo@zoho.com>\n> >> wrote:\n> >>>\n> >>> Hi All,\n> >>>\n> >>> I am trying to write a script to tell me the latest revision\n> >>> showing on\n> >>>\n> >>> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n> >>>\n> >>> which is 'virtio-win: rebase on 0.164\", but I can only see this\n> >>> from a web browser, as the page is dynamic.\n> >>>\n> >>> I do have access to the git link on that page:\n> >>>\n> >>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> >>>\n> >>> Does git (or some other) have a way of telling me\n> >>> JUST the revision without having to download the turkey?\n> >>\n> >> If you just want the commit ID, you can use for example:\n> >>\n> >> $ git ls-remote\n> >> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> >> refs/heads/master\n> >> f6ad44f35f5caeec51b7002169977272d85701a3        refs/heads/master\n> >>\n> >>> If I could get something that contained\n> >>>          virtio-win: rebase on 0.164\n> >>> I could dig out the revision\n> >>\n> >> You might also want to take a look at the GitLab API docs, for example:\n> >>\n> >> https://docs.gitlab.com/ee/api/commits.html\n> >>\n> >> Best,\n> >> Christian.\n> >>\n> >\n> > Hi Christian,\n> >\n> > I do not mean to be dense, but how do I get\n> > \"virtio-win: rebase on 0.164\" out of:\n> > \" f6ad44f35f5caeec51b7002169977272d85701a3  refs/heads/master\"?\n> >\n> > Perplexed,\n> > -T\n>\n>\n> Found something that worked:\n>\n> $ curl --silent\n> 'https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/commits/master'\n> | grep  rebase\n>\n> <a class=\"commit-row-message item-title js-onboarding-commit-item \"\n> href=\"/spice/win32/spice-nsis/-/commit/f6ad44f35f5caeec51b7002169977272d85701a3\">virtio-win:\n> rebase on 0.164</a>\n>\n> <a class=\"commit-row-message item-title js-onboarding-commit-item \"\n> href=\"/spice/win32/spice-nsis/-/commit/d6836f79ba8deeef5b7719fd94cc208b81eb70df\">virtio-win:\n> rebase on 0.164</a>\n\nIf I needed more information than just the commit ID, I would use the\nGitLab API, especially:\n\nhttps://docs.gitlab.com/ee/api/commits.html#get-a-single-commit\n\nSo you might want to customize this example command:\n\n$ curl --header \"PRIVATE-TOKEN: <your_access_token>\"\n\"https://gitlab.example.com/api/v4/projects/5/repository/commits/master\"\n"},{"id":"438472","messageId":"CACx-yZ06b8drep=MqBS=9Vf2fNLmUXh69VpZg4pdxtHDb7cxrQ@mail.gmail.com","threadId":"56679","inReplyTo":"a12adb98-d8c1-cd36-1760-343360a9ba85@zoho.com","subject":"Re: I just want the revision","fromName":"Daniel Knittl-Frank","fromEmail":"knittl89@googlemail.com","sentAt":"2021-10-11T16:02:20Z","receivedAt":"2021-10-11T16:02:43Z","isPatch":false,"sender":{"key":"knittl89@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/2149217?v=4"},"body":"That seems to be the commit subject. One simple way would be to use\ngit log in a clone of the repo:\n\n    git log -1 --pretty=format:%s origin/master\n\nYou can also use git cat-file to get a bit more output (commit id,\ntree id, author and committer info, full commit message):\n\n    git cat-file -p origin/master\n\nHTH\nDaniel\n\n\nOn Mon, Oct 11, 2021 at 12:09 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n>\n> On 10/11/21 02:45, Christian Couder wrote:\n> > Hi,\n> >\n> > On Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n> >>\n> >> Hi All,\n> >>\n> >> I am trying to write a script to tell me the latest revision\n> >> showing on\n> >>\n> >> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n> >>\n> >> which is 'virtio-win: rebase on 0.164\", but I can only see this\n> >> from a web browser, as the page is dynamic.\n> >>\n> >> I do have access to the git link on that page:\n> >>\n> >> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> >>\n> >> Does git (or some other) have a way of telling me\n> >> JUST the revision without having to download the turkey?\n> >\n> > If you just want the commit ID, you can use for example:\n> >\n> > $ git ls-remote\n> > https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> > refs/heads/master\n> > f6ad44f35f5caeec51b7002169977272d85701a3        refs/heads/master\n> >\n> >> If I could get something that contained\n> >>          virtio-win: rebase on 0.164\n> >> I could dig out the revision\n> >\n> > You might also want to take a look at the GitLab API docs, for example:\n> >\n> > https://docs.gitlab.com/ee/api/commits.html\n> >\n> > Best,\n> > Christian.\n> >\n>\n> Hi Christian,\n>\n> I do not mean to be dense, but how do I get\n> \"virtio-win: rebase on 0.164\" out of:\n> \" f6ad44f35f5caeec51b7002169977272d85701a3  refs/heads/master\"?\n>\n> Perplexed,\n> -T\n\n\n\n-- \ntyped with http://neo-layout.org\n"},{"id":"438476","messageId":"YWRjztTfBNvKbsWR@coredump.intra.peff.net","threadId":"56679","inReplyTo":"e257c62e-edff-f559-95e7-374b623a3f61@zoho.com","subject":"Re: I just want the revision","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-10-11T16:18:22Z","receivedAt":"2021-10-11T16:19:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Oct 10, 2021 at 07:37:12PM -0700, ToddAndMargo wrote:\n\n> I am trying to write a script to tell me the latest revision\n> showing on\n> \n> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n> \n> which is 'virtio-win: rebase on 0.164\", but I can only see this\n> from a web browser, as the page is dynamic.\n> \n> I do have access to the git link on that page:\n> \n> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> \n> Does git (or some other) have a way of telling me\n> JUST the revision without having to download the turkey?\n\nI'd probably use an API provided by the hosting service in this case, as\nChristian recommended, since it will be the most efficient route. But\njust for the sake of completeness, if you wanted to limit yourself only\nto Git commands, you could make a partial shallow clone of a single\nbranch like this:\n\n  git clone --bare --depth 1 --filter=tree:0 \\\n\thttps://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n  cd spice-nsis.git\n  git log -1 --format=%s\n\nThat should fetch only a single object. You only get the HEAD branch\nbecause --depth implies --single-branch. You can use \"clone -b\" to get a\ndifferent branch if you want.\n\n-Peff\n"},{"id":"438508","messageId":"64c7dd07-495d-7efe-f4aa-7ea91830c783@zoho.com","threadId":"56679","inReplyTo":"CAP8UFD0TBOkNU2g_OqpMiQyopBfae95nBwJQJ8F04+C1FcBRYQ@mail.gmail.com","subject":"Re: I just want the revision","fromName":"ToddAndMargo","fromEmail":"toddandmargo@zoho.com","sentAt":"2021-10-11T21:51:59Z","receivedAt":"2021-10-11T21:52:24Z","isPatch":false,"sender":{"key":"toddandmargo@zoho.com","avatar":null},"body":"On 10/11/21 06:13, Christian Couder wrote:\n> On Mon, Oct 11, 2021 at 12:24 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n>>\n>> On 10/11/21 03:09, ToddAndMargo wrote:\n>>> On 10/11/21 02:45, Christian Couder wrote:\n>>>> Hi,\n>>>>\n>>>> On Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo <ToddAndMargo@zoho.com>\n>>>> wrote:\n>>>>>\n>>>>> Hi All,\n>>>>>\n>>>>> I am trying to write a script to tell me the latest revision\n>>>>> showing on\n>>>>>\n>>>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n>>>>>\n>>>>> which is 'virtio-win: rebase on 0.164\", but I can only see this\n>>>>> from a web browser, as the page is dynamic.\n>>>>>\n>>>>> I do have access to the git link on that page:\n>>>>>\n>>>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n>>>>>\n>>>>> Does git (or some other) have a way of telling me\n>>>>> JUST the revision without having to download the turkey?\n>>>>\n>>>> If you just want the commit ID, you can use for example:\n>>>>\n>>>> $ git ls-remote\n>>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n>>>> refs/heads/master\n>>>> f6ad44f35f5caeec51b7002169977272d85701a3        refs/heads/master\n>>>>\n>>>>> If I could get something that contained\n>>>>>           virtio-win: rebase on 0.164\n>>>>> I could dig out the revision\n>>>>\n>>>> You might also want to take a look at the GitLab API docs, for example:\n>>>>\n>>>> https://docs.gitlab.com/ee/api/commits.html\n>>>>\n>>>> Best,\n>>>> Christian.\n>>>>\n>>>\n>>> Hi Christian,\n>>>\n>>> I do not mean to be dense, but how do I get\n>>> \"virtio-win: rebase on 0.164\" out of:\n>>> \" f6ad44f35f5caeec51b7002169977272d85701a3  refs/heads/master\"?\n>>>\n>>> Perplexed,\n>>> -T\n>>\n>>\n>> Found something that worked:\n>>\n>> $ curl --silent\n>> 'https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/commits/master'\n>> | grep  rebase\n>>\n>> <a class=\"commit-row-message item-title js-onboarding-commit-item \"\n>> href=\"/spice/win32/spice-nsis/-/commit/f6ad44f35f5caeec51b7002169977272d85701a3\">virtio-win:\n>> rebase on 0.164</a>\n>>\n>> <a class=\"commit-row-message item-title js-onboarding-commit-item \"\n>> href=\"/spice/win32/spice-nsis/-/commit/d6836f79ba8deeef5b7719fd94cc208b81eb70df\">virtio-win:\n>> rebase on 0.164</a>\n> \n> If I needed more information than just the commit ID, I would use the\n> GitLab API, especially:\n> \n> https://docs.gitlab.com/ee/api/commits.html#get-a-single-commit\n> \n> So you might want to customize this example command:\n> \n> $ curl --header \"PRIVATE-TOKEN: <your_access_token>\"\n> \"https://gitlab.example.com/api/v4/projects/5/repository/commits/master\"\n> \n\nno idea what the \" <your_access_token>\" is.\n\n-- \n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nComputers are like air conditioners.\nThey malfunction when you open windows\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"},{"id":"438510","messageId":"CAP8UFD3Qbvz3Gj1M2VqtsdAK=ucZ_FgC5RV284yX=7Y6xh_E6g@mail.gmail.com","threadId":"56679","inReplyTo":"64c7dd07-495d-7efe-f4aa-7ea91830c783@zoho.com","subject":"Re: I just want the revision","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2021-10-11T22:43:59Z","receivedAt":"2021-10-11T22:44:15Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Oct 11, 2021 at 11:52 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:\n>\n> On 10/11/21 06:13, Christian Couder wrote:\n\n> > If I needed more information than just the commit ID, I would use the\n> > GitLab API, especially:\n> >\n> > https://docs.gitlab.com/ee/api/commits.html#get-a-single-commit\n> >\n> > So you might want to customize this example command:\n> >\n> > $ curl --header \"PRIVATE-TOKEN: <your_access_token>\"\n> > \"https://gitlab.example.com/api/v4/projects/5/repository/commits/master\"\n> >\n>\n> no idea what the \" <your_access_token>\" is.\n\nThis is a mailing list about Git, not GitLab or other service\nproviders, so I don't want to go into too many details here. As I\nalready explained you should look at the docs for more details.\nAlternatively you can google it or ask in a GitLab forum or to GitLab\nsupport if you have paid for that.\n"},{"id":"438512","messageId":"6ad91bd9-5c3b-bbec-90e9-baa338b747e4@zoho.com","threadId":"56679","inReplyTo":"e257c62e-edff-f559-95e7-374b623a3f61@zoho.com","subject":"Re: I just want the revision","fromName":"ToddAndMargo","fromEmail":"toddandmargo@zoho.com","sentAt":"2021-10-12T01:03:41Z","receivedAt":"2021-10-12T01:03:49Z","isPatch":false,"sender":{"key":"toddandmargo@zoho.com","avatar":null},"body":"On 10/10/21 19:37, ToddAndMargo wrote:\n> Hi All,\n> \n> I am trying to write a script to tell me the latest revision\n> showing on\n> \n> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master\n> \n> which is 'virtio-win: rebase on 0.164\", but I can only see this\n> from a web browser, as the page is dynamic.\n> \n> I do have access to the git link on that page:\n> \n> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git\n> \n> Does git (or some other) have a way of telling me\n> JUST the revision without having to download the turkey?\n> \n> If I could get something that contained\n>         virtio-win: rebase on 0.164\n> I could dig out the revision\n> \n> Many thanks,\n> -T\n\nThis simulates what I came up with in my actual code:\n\n$ curl --silent \n'https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/commits/master' \n| raku -ne 'my Str $x=slurp(); $x~~s/.*? \"rebase on \" //; $x~~s/ \n(\"</a>\") .* //; print \"$x\\n\";'\n\n0.164\n\n\nThank you all for the tips!\n"}]}