git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git auto-repack is broken...
@ 2011-12-02 16:22 Linus Torvalds
  2011-12-02 16:27 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 19+ messages in thread
From: Linus Torvalds @ 2011-12-02 16:22 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List

I actually tend to repack things pretty religiously (ok, not really,
but I do "git gc" reasonably regularly, so I was surprised to see
thig:

  Auto packing the repository for optimum performance. You may also
  run "git gc" manually. See "git help gc" for more information.

followed by this pitiful effort:

  Counting objects: 8, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (8/8), done.
  Writing objects: 100% (8/8), done.
  Total 8 (delta 0), reused 0 (delta 0)

Ok, those 8 objects will *not* help anything at all, and the
autorepack is broken.

So what's going on? It turns out that I have a fair amount of
unreachable objects in this repository, because I do things like
fetching things without then merging them, etc. So the "git gc --auto"
will happily do "git repack -A" or whatever, and that in turn does
*nothing* what-so-ever (or rather, it packs my latest merge commit
like the above and generates that pack of a whopping 8 objects).

I can fix it with "git gc --prune=now", so it's not like I personally
really care, but since the whole point of "git gc --auto" is to allow
people who don't know what they are doing to ignore the whole issue of
GC and pruning, I do think this is a real UI bug.

I don't really have any suggestions for fixing it, though. Maybe we
should make "git gc --auto" remove any unreachable objects? That would
be potentially dangerous in shared repository situations, though. Or
have an extra option to "git repack -A" to also pack any loose objects
it finds at the end (whether reachable or not)?

                         Linus

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: git auto-repack is broken...
@ 2011-12-03  6:55 George Spelvin
  0 siblings, 0 replies; 19+ messages in thread
From: George Spelvin @ 2011-12-03  6:55 UTC (permalink / raw)
  To: git; +Cc: linux, peff

Thanks, Jeff, for the life-cycle chart.

A couple of ideas come to mind:
- When unpacking objects from a pack, it should be fine to set their
  date to that of the pack.  After all, they're at least that old.
- We could put unreferenced objects into packs whose date is the most
  recent of any of the contained objects.
- We could then group unreferenced objects into packs based on age,
  so their ages sould not be affected too much by the preceding
  operations.

That still produces a noticeable number of packs, which isn't
good, but maybe it's better that keeping thousands of loose
objects for a month...

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-12-09 18:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02 16:22 git auto-repack is broken Linus Torvalds
2011-12-02 16:27 ` Ævar Arnfjörð Bjarmason
2011-12-02 16:56   ` Linus Torvalds
2011-12-02 17:10     ` Jeff King
2011-12-02 17:35       ` Junio C Hamano
2011-12-02 17:45         ` Jeff King
2011-12-02 18:08           ` Junio C Hamano
2011-12-02 18:13             ` Jeff King
2011-12-03 19:42           ` Brandon Casey
2011-12-07 22:12             ` Nicolas Pitre
2011-12-07 22:53               ` Jeff King
2011-12-08  0:18                 ` Nicolas Pitre
2011-12-08  0:45                   ` Jeff King
2011-12-08  3:35                     ` Nicolas Pitre
2011-12-08  3:40                       ` Jeff King
2011-12-09 17:35               ` Junio C Hamano
2011-12-09 18:34                 ` Nicolas Pitre
2011-12-08  0:49             ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2011-12-03  6:55 George Spelvin

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).