All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: ToddAndMargo <ToddAndMargo@zoho.com>
Cc: git@vger.kernel.org
Subject: Re: I just want the revision
Date: Mon, 11 Oct 2021 12:18:22 -0400	[thread overview]
Message-ID: <YWRjztTfBNvKbsWR@coredump.intra.peff.net> (raw)
In-Reply-To: <e257c62e-edff-f559-95e7-374b623a3f61@zoho.com>

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

  parent reply	other threads:[~2021-10-11 16:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11  2:37 I just want the revision ToddAndMargo
2021-10-11  9:45 ` Christian Couder
2021-10-11 10:09   ` ToddAndMargo
2021-10-11 10:24     ` ToddAndMargo
2021-10-11 13:13       ` Christian Couder
2021-10-11 21:51         ` ToddAndMargo
2021-10-11 22:43           ` Christian Couder
2021-10-11 16:02     ` Daniel Knittl-Frank
2021-10-11 16:18 ` Jeff King [this message]
2021-10-12  1:03 ` ToddAndMargo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YWRjztTfBNvKbsWR@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=ToddAndMargo@zoho.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.