git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Phil Lawrence <prlawrence@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: How can I tell if anything was fetched?
Date: Thu, 11 Oct 2012 18:45:09 +0200	[thread overview]
Message-ID: <m28vbdkley.fsf@igel.home> (raw)
In-Reply-To: <CAFRB3XkueafikCvwzBb+WOAG_1mEkVg1Yt6=teOuVwYd2zWVOw@mail.gmail.com> (Phil Lawrence's message of "Thu, 11 Oct 2012 09:25:23 -0700")

Phil Lawrence <prlawrence@gmail.com> writes:

> One approach might be to first generate a state-of-the-repo SHA1:
>     # http://stackoverflow.com/a/7350019/834039
>     # http://git-scm.com/book/ch9-2.html
>     {
>         git rev-list --objects --all
>         git rev-list --objects -g --no-walk --all
>         git rev-list --objects --no-walk \
>             $(git fsck --unreachable |
>               grep '^unreachable commit' |
>               cut -d' ' -f3)
>     } | sort | uniq | git hash-object -w --stdin

I think you'd only need to record the state of all refs (eg. the output
of `git for-each-ref') to reliably detect any changes.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2012-10-11 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 16:25 How can I tell if anything was fetched? Phil Lawrence
2012-10-11 16:45 ` Andreas Schwab [this message]
2012-10-11 18:29   ` Enrico Weigelt
2012-10-12  7:47   ` Jeff King
2012-10-12  6:28 ` Johannes Sixt

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=m28vbdkley.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=git@vger.kernel.org \
    --cc=prlawrence@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).