git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git gc and git repack

From
SCSergio Callegari <scallegari@arces.unibo.it>
Date
Mar 6, 2007, 16:13 UTC
Message-ID
<loom.20070306T165455-693@post.gmane.org>
Hi,

I am puzzled by a different behavior when doing housekeeping with git-gc and git-repack:

On a repository I have, git gc gives:
Generating pack...
Done counting 75 objects.
Deltifying 75 objects.
 100% (75/75) done
Writing 75 objects.
 100% (75/75) done
Total 75 (delta 26), reused 68 (delta 26)
Pack pack-a989a4c4c7454874220cf502865ab9a28952499f created.
Removing unused objects 100%...
Done.
while git repack -a -d gives
Generating pack...
Done counting 143 objects.
Deltifying 143 objects.
 100% (143/143) done
Writing 143 objects.
 100% (143/143) done
Total 143 (delta 49), reused 120 (delta 31)
Pack pack-d17fd54437f04fbde34088909e31e95718e7b8c5 created.
Removing unused objects 100%...
Done.

Why is a different number of objects being considered in the two case, with git repack considering more objects and producing a different pack? Also, the package produced by repack turns out to be much larger than the one by git gc... In any case, both packages turn out to be git-fsck clean...

I suspect, this has to to with my repository using alternates... (in fact git-gc and git-repack start behaving identically if I pass the -l (local) option to repack... can anyone confirm that this is the only difference?

Also can anybody confirm whether git repack -a -d actually includes in the pack also _all_ the "borrowed" objects? I.e. if it is in fact a way to convert a repository that borrows objects into one that is self-standing?

Next: Johannes Schindelin
Message 1 of 2 in “git gc and git repack”
  1. Sergio CallegariMar 6, 2007
  2. Johannes SchindelinMar 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.