Re: I just want the revision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 10, 2021 at 07:37:12PM -0700, ToddAndMargo wrote:

> 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?

I'd probably use an API provided by the hosting service in this case, as
Christian recommended, since it will be the most efficient route. But
just for the sake of completeness, if you wanted to limit yourself only
to Git commands, you could make a partial shallow clone of a single
branch like this:

  git clone --bare --depth 1 --filter=tree:0 \
	https://gitlab.freedesktop.org/spice/win32/spice-nsis.git
  cd spice-nsis.git
  git log -1 --format=%s

That should fetch only a single object. You only get the HEAD branch
because --depth implies --single-branch. You can use "clone -b" to get a
different branch if you want.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux