Subject: Re: [PATCH 2/2] gc: Remove garbage .idx files from pack dir

From: Junio C Hamano <[email-masked]>
Date: Mon, 17 Aug 2015 13:30:53 -0700

Doug Kelly <[email-masked]> writes:

> +static struct string_list pack_garbage = STRING_LIST_INIT_DUP;
> +
>  static char *pidfile;
>  
> +static void clean_pack_garbage(void)
> +{
> +	int i;
> +	for (i = 0; i < pack_garbage.nr; i++)
> +		unlink_or_warn(pack_garbage.items[i].string);
> +	string_list_clear(&pack_garbage, 0);
> +}
> +
>  static void remove_pidfile(void)
>  {
>  	if (pidfile)
> @@ -57,6 +67,12 @@ static void remove_pidfile_on_signal(int signo)
>  	raise(signo);
>  }
>  
> +static void report_pack_garbage(unsigned seen_bits, const char *path)

This change makes"pidfile management" and "pack garbage cleaning"
tangled in the result.  By inserting the definition of the variable
pack_garbage and the function clean_pack_garbage() just before this
new function, you can keep everything related to 'pack garbage
cleaning" together.