-
Notifications
You must be signed in to change notification settings - Fork 143
Maintenance II: prefetch, loose-objects, incremental-repack tasks #696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7a62e22
f3a16fd
b3e577f
5d8f40c
c705a26
33677a1
46c2216
9fc7c0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,21 @@ maintenance.commit-graph.auto:: | |
reachable commits that are not in the commit-graph file is at least | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
|
||
the value of `maintenance.commit-graph.auto`. The default value is | ||
100. | ||
|
||
maintenance.loose-objects.auto:: | ||
This integer config option controls how often the `loose-objects` task | ||
should be run as part of `git maintenance run --auto`. If zero, then | ||
the `loose-objects` task will not run with the `--auto` option. A | ||
negative value will force the task to run every time. Otherwise, a | ||
positive value implies the command should run when the number of | ||
loose objects is at least the value of `maintenance.loose-objects.auto`. | ||
The default value is 100. | ||
|
||
maintenance.incremental-repack.auto:: | ||
This integer config option controls how often the `incremental-repack` | ||
task should be run as part of `git maintenance run --auto`. If zero, | ||
then the `incremental-repack` task will not run with the `--auto` | ||
option. A negative value will force the task to run every time. | ||
Otherwise, a positive value implies the command should run when the | ||
number of pack-files not in the multi-pack-index is at least the value | ||
of `maintenance.incremental-repack.auto`. The default value is 10. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,21 @@ commit-graph:: | |
`commit-graph-chain` file. They will be deleted by a later run based | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
|
||
on the expiration delay. | ||
|
||
prefetch:: | ||
The `prefetch` task updates the object directory with the latest | ||
objects from all registered remotes. For each remote, a `git fetch` | ||
command is run. The refmap is custom to avoid updating local or remote | ||
branches (those in `refs/heads` or `refs/remotes`). Instead, the | ||
remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are | ||
not updated. | ||
+ | ||
This is done to avoid disrupting the remote-tracking branches. The end users | ||
expect these refs to stay unmoved unless they initiate a fetch. With prefetch | ||
task, however, the objects necessary to complete a later real fetch would | ||
already be obtained, so the real fetch would go faster. In the ideal case, | ||
it will just become an update to bunch of remote-tracking branches without | ||
any object transfer. | ||
|
||
gc:: | ||
Clean up unnecessary files and optimize the local repository. "GC" | ||
stands for "garbage collection," but this task performs many | ||
|
@@ -55,6 +70,39 @@ gc:: | |
be disruptive in some situations, as it deletes stale data. See | ||
linkgit:git-gc[1] for more details on garbage collection in Git. | ||
|
||
loose-objects:: | ||
The `loose-objects` job cleans up loose objects and places them into | ||
pack-files. In order to prevent race conditions with concurrent Git | ||
commands, it follows a two-step process. First, it deletes any loose | ||
objects that already exist in a pack-file; concurrent Git processes | ||
will examine the pack-file for the object data instead of the loose | ||
object. Second, it creates a new pack-file (starting with "loose-") | ||
containing a batch of loose objects. The batch size is limited to 50 | ||
thousand objects to prevent the job from taking too long on a | ||
repository with many loose objects. The `gc` task writes unreachable | ||
objects as loose objects to be cleaned up by a later step only if | ||
they are not re-added to a pack-file; for this reason it is not | ||
advisable to enable both the `loose-objects` and `gc` tasks at the | ||
same time. | ||
|
||
incremental-repack:: | ||
The `incremental-repack` job repacks the object directory | ||
using the `multi-pack-index` feature. In order to prevent race | ||
conditions with concurrent Git commands, it follows a two-step | ||
process. First, it calls `git multi-pack-index expire` to delete | ||
pack-files unreferenced by the `multi-pack-index` file. Second, it | ||
calls `git multi-pack-index repack` to select several small | ||
pack-files and repack them into a bigger one, and then update the | ||
`multi-pack-index` entries that refer to the small pack-files to | ||
refer to the new pack-file. This prepares those small pack-files | ||
for deletion upon the next run of `git multi-pack-index expire`. | ||
The selection of the small pack-files is such that the expected | ||
size of the big pack-file is at least the batch size; see the | ||
`--batch-size` option for the `repack` subcommand in | ||
linkgit:git-multi-pack-index[1]. The default batch-size is zero, | ||
which is a special case that attempts to repack all pack-files | ||
into a single pack-file. | ||
|
||
OPTIONS | ||
------- | ||
--auto:: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Derrick Stolee wrote (reply to this):