Re: [PATCH v2 1/5] Add convenient function to do automatic garbage collection
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 18, 2012, 22:37 UTC
- Message-ID
- <xmqqvcjt15g5.fsf@junio.mtv.corp.google.com>
- In-Reply-To
- <1337171377-26960-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 13 quoted lines
> This function also avoids forking most of the time by performing some
> check in process.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ...
> @@ -64,6 +66,10 @@ static int gc_config(const char *var, const char *value, void *cb)
> }
> return git_config_string(&prune_expire, var, value);
> }
> + if (cb && !strcmp(var, cb)) {
> + auto_gc = git_config_bool(var, value);
> + return 0;
> + }This does not look like "add convenient function for auto-gc" nor "avoid forking"; it is something else that is not explained.
> +int gc(const char *cmd, int flags)
Don't call this "gc".
It is hardcoded to perform a cheaper version "gc --auto" and nothing else, and it may not even do that when configured not to.
I do not think the first parameter to this function is "cmd" (abbreviation of "command") either. Isn't it a configuration key to tell if auto-gc is allowed, or something?
Other than that, it seems to be a nice change.