Subject: Re: [PATCH 2/9] refs: cleanup code around optimization

From: Patrick Steinhardt <[email-masked]>
Date: Fri, 10 Oct 2025 13:22:19 +0200

On Fri, Oct 10, 2025 at 12:27:06PM +0200, Karthik Nayak wrote:
> The previous commit, moved all backends to only use/support the
> 'optimize' function within the `ref_store` structure. With this, cleanup
> all references to the 'pack_refs' field of the structure and code around
> it.
> 
> Modify existing documentation in this regard.

Makes sense.

> diff --git a/refs.h b/refs.h
> index 2dd7ac1a16..c6c955d78d 100644
> --- a/refs.h
> +++ b/refs.h
> @@ -514,15 +514,11 @@ struct pack_refs_opts {
>  	struct string_list *includes;
>  };
>  
> -/*
> - * Write a packed-refs file for the current repository.
> - * flags: Combination of the above PACK_REFS_* flags.
> - */
> -int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts);
> -
>  /*
>   * Optimize the ref store. The exact behavior is up to the backend.
>   * For the files backend, this is equivalent to packing refs.
> + *
> + * flags: Combination of the above PACK_REFS_* flags.
>   */
>  int refs_optimize(struct ref_store *refs, struct pack_refs_opts *opts);
>  

I don't think it makes sense to carry over this documentation here. If
not already the case, we should document the `struct opts::flags` field
in the structure itself.

Patrick