Subject: Re: [PATCH v4 08/17] builtin/pack-objects.c: --cruft without expiration

From: Junio C Hamano <[email-masked]>
Date: Thu, 19 May 2022 03:04:18 -0700

Taylor Blau <[email-masked]> writes:

> @@ -3870,6 +4034,20 @@ static int option_parse_unpack_unreachable(const struct option *opt,
>  	return 0;
>  }
>  
> +static int option_parse_cruft_expiration(const struct option *opt,
> +					 const char *arg, int unset)
> +{
> +	if (unset) {
> +		cruft = 0;
> +		cruft_expiration = 0;
> +	} else {
> +		cruft = 1;
> +		if (arg)
> +			cruft_expiration = approxidate(arg);
> +	}
> +	return 0;
> +}

It is somewhat sad that we have to invent this function, instead of
using parse_opt_expiry_date_cb().