Class: Git::Commands::Repack Private
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
arguments block audited against
https://git-scm.com/docs/git-repack/2.53.0
Wrapper for the git repack command
Packs unpacked objects in a repository into pack files, and can reorganize
existing packs into a single, more efficient pack. Running git repack -a -d
is the most common usage: pack all objects and delete redundant packs.
Examples:
Pack all objects and delete redundant packs
Pack all objects and delete redundant packs
repack = Git::Commands::Repack.new(execution_context)
repack.call(a: true, d: true)
Pack all objects with bitmap index
Pack all objects with bitmap index
repack = Git::Commands::Repack.new(execution_context)
repack.call(a: true, d: true, write_bitmap_index: true)
Control delta compression performance
Control delta compression performance
repack = Git::Commands::Repack.new(execution_context)
repack.call(a: true, d: true, window: 250, depth: 50)
See Also:
Instance Method Summary collapse
-
#call(**options) ⇒ Git::CommandLineResult
Execute the
git repackcommand.
Methods inherited from Base
allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation
Constructor Details
This class inherits a constructor from Git::Commands::Base
Instance Method Details
#call(**options) ⇒ Git::CommandLineResult
Execute the git repack command
Parameters:
-
options
(Hash)
—
command options
Options Hash (**options):
-
:a
(Boolean, nil)
— default:
nil
—
pack all objects into a single pack
When
true, passes-a. Especially useful when packing a repository used for private development. Use with:dto clean up objects. -
:A
(Boolean, nil)
— default:
nil
—
pack all objects, loosening unreachable objects when combined with
:dWhen
true, passes-A. Like:a, but any unreachable objects in a previous pack become loose unpacked objects instead of being removed. The loose unreachable objects are pruned by the nextgit gcinvocation. -
:d
(Boolean, nil)
— default:
nil
—
delete redundant packs after repacking
When
true, passes-d. After packing, removes any existing packs that are made redundant by the newly created pack. Also runsgit prune-packed. -
:cruft
(Boolean, nil)
— default:
nil
—
pack unreachable objects into a separate cruft pack when combined with
:dWhen
true, passes--cruft. Like:a, but any unreachable objects are packed into a separate cruft pack instead of being removed. Incompatible with:keep_unreachable. -
:cruft_expiration
(String)
— default:
nil
—
expire cruft objects older than the given date immediately
Passed as
--cruft-expiration=<approxidate>. Only useful with--cruft -d. -
:max_cruft_size
(Integer, String)
— default:
nil
—
override
--max-pack-sizefor cruft packsPassed as
--max-cruft-size=<n>. Accepts size suffixes (k,m,g). Inherits the value of:max_pack_sizeby default. -
:combine_cruft_below_size
(Integer, String)
— default:
nil
—
only repack cruft packs strictly smaller than this size
Passed as
--combine-cruft-below-size=<n>. Accepts size suffixes (k,m,g). Useful to avoid repacking large cruft packs. -
:expire_to
(String)
— default:
nil
—
write pruned cruft objects to a directory
Passed as
--expire-to=<dir>. Only useful with--cruft -d. -
:l
(Boolean, nil)
— default:
nil
—
pass
--localtogit pack-objectsWhen
true, passes-l. Ignores objects that come from an alternates object store. -
:f
(Boolean, nil)
— default:
nil
—
pass
--no-reuse-deltatogit pack-objectsWhen
true, passes-f. Forces reconstruction of all pack deltas. -
:F
(Boolean, nil)
— default:
nil
—
pass
--no-reuse-objecttogit pack-objectsWhen
true, passes-F. Forces reconstruction of all object data, not just deltas. -
:quiet
(Boolean, nil)
— default:
nil
—
suppress progress reporting
When
true, passes--quiet.Alias:
:q -
:n
(Boolean, nil)
— default:
nil
—
do not update server information
When
true, passes-n. Skips runninggit update-server-info, which updates local catalog files needed to publish the repository over HTTP or FTP. -
:window
(Integer, String)
— default:
nil
—
number of previous objects used to generate delta compressions
Passed as
--window=<n>togit pack-objects. -
:depth
(Integer, String)
— default:
nil
—
maximum delta depth
Passed as
--depth=<n>togit pack-objects. -
:threads
(Integer, String)
— default:
nil
—
number of threads for delta search
Passed as
--threads=<n>togit pack-objects. -
:window_memory
(Integer, String)
— default:
nil
—
maximum memory usage for delta window
Passed as
--window-memory=<n>togit pack-objects. Accepts size suffixes (k,m,g). -
:max_pack_size
(Integer, String)
— default:
nil
—
maximum size of each output pack file
Passed as
--max-pack-size=<n>. Accepts size suffixes (k,m,g). -
:filter
(String)
— default:
nil
—
remove objects matching the filter specification from the resulting packfile
Passed as
--filter=<filter-spec>. Filtered objects are placed in a separate packfile. Best used with-a -dand in a bare repository. -
:filter_to
(String)
— default:
nil
—
write the pack containing filtered objects to a directory
Passed as
--filter-to=<dir>. Only useful with:filter. -
:write_bitmap_index
(Boolean, nil)
— default:
nil
—
write a reachability bitmap index as part of the repack
When
true, passes--write-bitmap-index. Only meaningful when used with:a,:A, or:write_midx. Overridesrepack.writeBitmaps.Alias:
:b -
:pack_kept_objects
(Boolean, nil)
— default:
nil
—
include objects in
.keepfiles when repackingWhen
true, passes--pack-kept-objects. Generally only useful when writing bitmaps with:write_bitmap_index. -
:keep_pack
(String, Array<String>)
— default:
nil
—
exclude named pack(s) from repacking
Pass a pack file name (without leading directory, e.g.
'pack-abc123.pack') or an array of pack file names. Each value is passed as a separate--keep-pack=<name>argument. -
:write_midx
(Boolean, nil)
— default:
nil
—
write a multi-pack index containing the non-redundant packs
When
true, passes--write-midx.Alias:
:m -
:unpack_unreachable
(String)
— default:
nil
—
do not loosen unreachable objects older than the given date
Passed as
--unpack-unreachable=<when>. Objects older than the given date are not loosened, since they would be immediately pruned by a follow-upgit prune. -
:keep_unreachable
(Boolean, nil)
— default:
nil
—
keep unreachable objects in the new packfile rather than removing them
When
true, passes--keep-unreachable. Appends unreachable objects from existing packs to the end of the new packfile. For use with-ad.Alias:
:k -
:delta_islands
(Boolean, nil)
— default:
nil
—
pass
--delta-islandstogit pack-objectsWhen
true, passes--delta-islands.Alias:
:i -
:geometric
(Integer, String)
— default:
nil
—
arrange pack structure so each successive pack contains at least this many times the objects of the next-largest pack
Passed as
--geometric=<factor>.Alias:
:g -
:name_hash_version
(Integer, String)
— default:
nil
—
pass
--name-hash-version=<n>togit pack-objects -
:path_walk
(Boolean, nil)
— default:
nil
—
pass
--path-walktogit pack-objects
Returns:
-
(Git::CommandLineResult)
—
the result of calling
git repack
Raises:
-
(ArgumentError)
—
if unsupported options are provided
-
(Git::FailedError)
—
if git exits with a non-zero exit status
|
|
# File 'lib/git/commands/repack.rb', line 87
|