Subject: Re: [GSOC PATCH v2 2/2] attr: use `repo_settings_get_attributesfile_path()` and update callers

From: Junio C Hamano <[email-masked]>
Date: Tue, 11 Mar 2025 10:03:18 -0700

shejialuo <[email-masked]> writes:

>> -static void bootstrap_attr_stack(struct index_state *istate,
>> +static void bootstrap_attr_stack(struct repository *repo, struct index_state *istate,
>
> I have scanned the definition of the "struct index_state", there is a
> "struct repository *repo" member in this data structure. This makes me
> think why do we need to pass the "struct repository *repo" in the first
> place. A design question, should we just use `istate->repo` directly?

Good thing to notice.

As the attribute system is all about giving extra information on the
paths that appear in the index and in the working tree, it may make
sense for the API to go from the index state which is about the
index and the working tree to access the attributes, rather than
from the repository structure, which controls a lot wider concept
and moving anything and everything there will easily and quickly
make it a messy kitchen sink.