From: ToddAndMargo Date: Mon, 11 Oct 2021 21:51:59 GMT Subject: Re: I just want the revision Message-ID: <64c7dd07-495d-7efe-f4aa-7ea91830c783@zoho.com> In-Reply-To: On 10/11/21 06:13, Christian Couder wrote: > On Mon, Oct 11, 2021 at 12:24 PM ToddAndMargo wrote: >> >> On 10/11/21 03:09, ToddAndMargo wrote: >>> On 10/11/21 02:45, Christian Couder wrote: >>>> Hi, >>>> >>>> On Mon, Oct 11, 2021 at 4:57 AM ToddAndMargo >>>> wrote: >>>>> >>>>> Hi All, >>>>> >>>>> I am trying to write a script to tell me the latest revision >>>>> showing on >>>>> >>>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/tree/master >>>>> >>>>> which is 'virtio-win: rebase on 0.164", but I can only see this >>>>> from a web browser, as the page is dynamic. >>>>> >>>>> I do have access to the git link on that page: >>>>> >>>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git >>>>> >>>>> Does git (or some other) have a way of telling me >>>>> JUST the revision without having to download the turkey? >>>> >>>> If you just want the commit ID, you can use for example: >>>> >>>> $ git ls-remote >>>> https://gitlab.freedesktop.org/spice/win32/spice-nsis.git >>>> refs/heads/master >>>> f6ad44f35f5caeec51b7002169977272d85701a3 refs/heads/master >>>> >>>>> If I could get something that contained >>>>> virtio-win: rebase on 0.164 >>>>> I could dig out the revision >>>> >>>> You might also want to take a look at the GitLab API docs, for example: >>>> >>>> https://docs.gitlab.com/ee/api/commits.html >>>> >>>> Best, >>>> Christian. >>>> >>> >>> Hi Christian, >>> >>> I do not mean to be dense, but how do I get >>> "virtio-win: rebase on 0.164" out of: >>> " f6ad44f35f5caeec51b7002169977272d85701a3 refs/heads/master"? >>> >>> Perplexed, >>> -T >> >> >> Found something that worked: >> >> $ curl --silent >> 'https://gitlab.freedesktop.org/spice/win32/spice-nsis/-/commits/master' >> | grep rebase >> >> > href="/spice/win32/spice-nsis/-/commit/f6ad44f35f5caeec51b7002169977272d85701a3">virtio-win: >> rebase on 0.164 >> >> > href="/spice/win32/spice-nsis/-/commit/d6836f79ba8deeef5b7719fd94cc208b81eb70df">virtio-win: >> rebase on 0.164 > > If I needed more information than just the commit ID, I would use the > GitLab API, especially: > > https://docs.gitlab.com/ee/api/commits.html#get-a-single-commit > > So you might want to customize this example command: > > $ curl --header "PRIVATE-TOKEN: " > "https://gitlab.example.com/api/v4/projects/5/repository/commits/master" > no idea what the " " is. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Computers are like air conditioners. They malfunction when you open windows ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~