git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Martin <amartin@xes-inc.com>
To: Jeff King <peff@peff.net>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>, git@vger.kernel.org
Subject: Re: git object-count differs between clones
Date: Wed, 3 Feb 2016 09:21:41 -0600 (CST)	[thread overview]
Message-ID: <386465007.95896.1454512901907.JavaMail.zimbra@xes-inc.com> (raw)
In-Reply-To: <20160203043411.GB21561@sigill.intra.peff.net>

----- Original Message -----
> From: "Jeff King" <peff@peff.net>
> To: "Andrew Martin" <amartin@xes-inc.com>
> Cc: "Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>, git@vger.kernel.org
> Sent: Tuesday, February 2, 2016 10:34:12 PM
> Subject: Re: git object-count differs between clones
> 
> On Tue, Feb 02, 2016 at 11:22:08AM -0600, Andrew Martin wrote:
> 
> > Thanks for the clarification. I now ran "git repack -A" followed by
> > "git gc --prune=now", however I am still seeing the same number of objects.
> > What
> > else can I try to successfully mark these and unreachable and garbage
> > collect them?
> 
> That should clear out any unreachable objects. Are we sure that the
> objects in question are, in fact, unreachable?
> 
> Try:
> 
>   git rev-list --objects --all --reflog | wc -l
> 
> which should give a count of reachable objects. I'd expect that to line
> up with that "git count-objects -v" reports after having run your gc
> above.
> 
> In your original email, the discrepancy was between your "original"
> repository and the one that had round-tripped to a clone. Is it possible
> there are refs in the original that did not get pushed? Try comparing
> "git for-each-ref" in each repository.
> 
> We also consider objects in the index to be reachable for packing. Could
> your original perhaps have some uncommitted objects mentioned in the
> index?
> 
> -Peff
> 

Jeff,

This did it - those commits were still referenced by some remotes:
$ git for-each-ref
945c3a60dfb4d9ab774708d19f7aa74dd545db90 commit refs/heads/master
945c3a60dfb4d9ab774708d19f7aa74dd545db90 commit refs/remotes/origin/brancha
8b331e4bb42f6291c33eb0847c4481407e3d753c commit refs/remotes/origin/branchb

I removed them:
$ git update-ref -d refs/remotes/origin/brancha
$ git update-ref -d refs/remotes/origin/branchb

And then I was able to garbage collect and get the expected object count:
$ git reflog expire --expire=now --expire-unreachable=now --all
$ git gc --prune=now

Thanks for the help!

Andrew

      reply	other threads:[~2016-02-03 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <57434188.709288.1454428054374.JavaMail.zimbra@xes-inc.com>
2016-02-02 15:52 ` git object-count differs between clones Andrew Martin
2016-02-02 16:09   ` Matthieu Moy
2016-02-02 16:21     ` Andrew Martin
2016-02-02 16:52       ` Jeff King
2016-02-02 17:22         ` Andrew Martin
2016-02-03  4:34           ` Jeff King
2016-02-03 15:21             ` Andrew Martin [this message]

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=386465007.95896.1454512901907.JavaMail.zimbra@xes-inc.com \
    --to=amartin@xes-inc.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).