From: Clemens Buchacher <drizzd@aon.at>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Is there a quick way to identify commits that reference missing trees or blobs?
Date: Tue, 26 Jul 2011 00:34:50 +0200 [thread overview]
Message-ID: <20110725223449.GA25560@toss.lan> (raw)
In-Reply-To: <CAH3AnroyfeGOo_23nHKhLjxEnP_qEMi7as1UjXEFjjuVOckBjw@mail.gmail.com>
On Sun, Jul 24, 2011 at 02:48:20AM +1000, Jon Seymour wrote:
>
> I was wondering if there is a quick way to identify commits that
> reference missing trees or blobs as identified by git fsck?
The following command has served me well for this purpose. I apply
it to each ref in git-for-each-ref:
$ git rev-list --objects $ref | git cat-file --batch-check
It may not be the fastest way to do it, but it did the trick for
me. I then simply deleted any broken refs using git update-ref -d
$ref, even if the tip of the branch was still intact. I could have
tried to salvage some history from those refs, but I had a backup
and at that point I just wanted to continue working.
hth,
Clemens
next prev parent reply other threads:[~2011-07-25 22:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-23 16:48 Is there a quick way to identify commits that reference missing trees or blobs? Jon Seymour
2011-07-25 22:34 ` Clemens Buchacher [this message]
2011-07-25 22:44 ` Clemens Buchacher
2011-07-26 1:39 ` Jon Seymour
2011-07-26 4:20 ` Jon Seymour
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=20110725223449.GA25560@toss.lan \
--to=drizzd@aon.at \
--cc=git@vger.kernel.org \
--cc=jon.seymour@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 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.