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

Re: git repack command on larger pack file

From
Philip Oakley <philipoakley@iee.org>
Date
Oct 27, 2015, 05:25 UTC
Message-ID
<D8169FC37A314B82930152F9DE817682@PhilipOakley>
In-Reply-To
<xmqqziz6hzom.fsf@gitster.mtv.corp.google.com>
From: "Junio C Hamano" <gitster@pobox.com>
Show 43 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Sivakumar Selvam <gerritcode@gmail.com> writes:
>>
>>> ... So
>>> I thought of splitting the pack file into 4 GB chunks.
>> ...
>> Hmmm, what is "this issue"?  I do not see anything surprising.
>
> While the explanation might have been enlightening, the knowledge
> conveyed by the explanation by itself would not be of much practical
> use, and enlightment without practical use is never fun.
>
> So let's do another tangent that may be more useful.
>
> In many repositories, older parts of the history often hold the bulk
> of objects that do not change, and it is wasteful to repack them
> over and over.  If your project is at around v40.0 today, and it was
> at around v36.0 6 months ago, for example, you may want to pack
> everything that happened before v36.0 into a single pack just once,
> pack them really well, and have your "repack" not touch that old
> part of the history.
>
>  $ git rev-list --objects v36.0 |
>    git pack-objects --window=200 --depth=128 pack
>
> would produce such a pack [*1*]
>
> The standard output from the above pipeline will give you a 40-hex
> string (e.g. 51c472761b4690a331c02c90ec364e47cca1b3ac, call it
> $HEX), and in the current directory you will find two files,
> pack-$HEX.pack and pack-$HEX.idx.
>
> You can then do this:
>
>  $ echo "v36.0 with W/D 200/128" >pack-$HEX.keep
>  $ mv pack-$HEX.* .git/objects/pack/.
>  $ git repack -a -d
>
> A pack that has an accompanying .keep file is excempt from
> repacking, so once you do this, your future "git repack" will only
> repack objects that are not in the kept packs.
>

I had a quick look at the man pages and couln't find an explanation (such as this one) to explain the purpose, highlight the use of and how to create such .keep packs.

Could this form the basis of a short section on .keep packs?(or did I miss something)

Show 10 quoted lines
>
>
> [Footnote]
>
> *1* I won't say 200/128 gives you a good pack; you would need to
> experiment.  In general, larger depth will result in smaller pack
> but it will result in bigger overhead while you use the repository
> every day.  Larger window will spend a lot of cycles while packing,
> but will result in a smaller pack.
> --
Philip 
Previous: Junio C HamanoNext: Jeff King
Message 8 of 9 in “git repack command on larger pack file”
  1. Sivakumar SelvamOct 26, 2015
  2. Junio C HamanoOct 26, 2015
  3. Junio C HamanoOct 26, 2015
  4. Sivakumar SelvamOct 27, 2015
  5. Jeff KingOct 27, 2015
  6. Junio C HamanoOct 28, 2015
  7. Junio C HamanoOct 28, 2015
  8. Philip OakleyOct 27, 2015
  9. Jeff KingOct 27, 2015

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.