-
Notifications
You must be signed in to change notification settings - Fork 141
Allow configuration for loose-objects maintenance task #1885
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
Allow configuration for loose-objects maintenance task #1885
Conversation
The --no-quiet option for 'git maintenance run' is supposed to indicate that progress should happen even while ignoring the value of isatty(2). However, Git implicitly asks child processes to check isatty(2) since these arguments are not passed through. The pass through of --no-quiet will be useful in a test in the next change. Signed-off-by: Derrick Stolee <[email protected]>
The 'loose-objects' task of 'git maintenance run' first deletes loose objects that exit within packfiles and then collects loose objects into a packfile. This second step uses an implicit limit of fifty thousand that cannot be modified by users. Add a new config option that allows this limit to be adjusted or ignored entirely. While creating tests for this option, I noticed that actually there was an off-by-one error due to the strict comparison in the limit check. I considered making the limit check turn true on equality, but instead I thought to use INT_MAX as a "no limit" barrier which should mean it's never possible to hit the limit. Thus, a new decrement to the limit is provided if the value is positive. (The restriction to positive values is to avoid underflow if INT_MIN is configured.) Signed-off-by: Derrick Stolee <[email protected]>
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
@@ -61,6 +61,11 @@ maintenance.loose-objects.auto:: | |||
loose objects is at least the value of `maintenance.loose-objects.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, Junio C Hamano wrote (reply to this):
"Derrick Stolee via GitGitGadget" <[email protected]> writes:
> From: Derrick Stolee <[email protected]>
>
> The 'loose-objects' task of 'git maintenance run' first deletes loose
> objects that exit within packfiles and then collects loose objects into
"exit" -> "exist"? It may read better to also do "collects" ->
"collects remaining".
> a packfile. This second step uses an implicit limit of fifty thousand
> that cannot be modified by users.
>
> Add a new config option that allows this limit to be adjusted or ignored
> entirely.
>
> While creating tests for this option, I noticed that actually there was
> an off-by-one error due to the strict comparison in the limit check.
Ahh, I, contrary to my usual routine, started reading from the code
change before reading the proposed log message and was wondering
about this exact point.
> + /* If batch_size is INT_MAX, then this will return 0 always. */
Cute ;-).
> return ++(d->count) > d->batch_size;
> }
This patch series was integrated into seen via git@e986d90. |
This branch is now known as |
This patch series was integrated into seen via git@92d1e7d. |
There was a status update in the "New Topics" section about the branch The job to coalesce loose objects into packfiles in "git maintenance" now has configurable batch size. Will merge to 'next'? source: <[email protected]> |
This patch series was integrated into seen via git@3fe8b45. |
This patch series was integrated into seen via git@df06b9c. |
This patch series was integrated into seen via git@1df0e66. |
There was a status update in the "Cooking" section about the branch The job to coalesce loose objects into packfiles in "git maintenance" now has configurable batch size. Will merge to 'next'. source: <[email protected]> |
This patch series was integrated into seen via git@f1af359. |
This patch series was integrated into next via git@a4e55af. |
This patch series was integrated into seen via git@b4ec3df. |
This patch series was integrated into seen via git@a4e55af. |
This patch series was integrated into seen via git@cafc5ca. |
This patch series was integrated into seen via git@768601a. |
There was a status update in the "Cooking" section about the branch The job to coalesce loose objects into packfiles in "git maintenance" now has configurable batch size. Will merge to 'master'. source: <[email protected]> |
This patch series was integrated into seen via git@322169d. |
This patch series was integrated into seen via git@d690c44. |
This patch series was integrated into master via git@d690c44. |
This patch series was integrated into next via git@d690c44. |
Closed via d690c44. |
The
loose-objects
task for thegit maintenance run
command has a hard-coded limit. The limit exists by default for the purposes of background maintenance, but can be misleading if users truly want to clean up all loose objects in one command (and don't want to usegit repack
). This adds a newmaintenance.loose-objects.batchSize
config option to help users adjust this value up or down.When testing, I noticed that progress indicators were not always provided when
isatty(2)
is false. This is because the--[no-]quiet
option was not appropriately passing to child processes. A small change fixes this before the config is added, so we can test the results usingstderr
output.Thanks,
cc: [email protected]