Re: [PATCH v4 02/19] convert: add [async_]convert_to_working_tree_ca() variants
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Dec 5, 2020, 11:10 UTC
- Message-ID
- <CAP8UFD398EON0OpfQ0=bgJhO-0r9f1Z7LQRj+rKLp9pEwUnxHA@mail.gmail.com>
- In-Reply-To
- <fc03417592c25a111fbf77f9e5b9e5468b9070ae.1604521275.git.matheus.bernardino@usp.br>
On Wed, Nov 4, 2020 at 9:33 PM Matheus Tavares <matheus.bernardino@usp.br> wrote:
Show 6 quoted lines
> > From: Jeff Hostetler <jeffhost@microsoft.com> > > Separate the attribute gathering from the actual conversion by adding > _ca() variants of the conversion functions. These variants receive a > precomputed 'struct conv_attrs', not relying, thus, on a index state.
s/a/an/
Show 15 quoted lines
> They will be used in a future patch adding parallel checkout support, > for two reasons: > > - We will already load the conversion attributes in checkout_entry(), > before conversion, to decide whether a path is eligible for parallel > checkout. Therefore, it would be wasteful to load them again later, > for the actual conversion. > > - The parallel workers will be responsible for reading, converting and > writing blobs to the working tree. They won't have access to the main > process' index state, so they cannot load the attributes. Instead, > they will receive the preloaded ones and call the _ca() variant of > the conversion functions. Furthermore, the attributes machinery is > optimized to handle paths in sequential order, so it's better to leave > it for the main process, anyway.
Well explained.
> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> > [matheus.bernardino: squash, remove one function definition and reword]
<rant++>I'd rather have "Reworked-by: Matheus Tavares <matheus.bernardino@usp.br>" or "Improved-by: Matheus Tavares <matheus.bernardino@usp.br>" than lines such as the above one.</rant++>
> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Show 6 quoted lines
> @@ -1447,7 +1447,7 @@ void convert_to_git_filter_fd(const struct index_state *istate, > ident_to_git(dst->buf, dst->len, dst, ca.ident); > } > > -static int convert_to_working_tree_internal(const struct index_state *istate, > +static int convert_to_working_tree_internal(const struct conv_attrs *ca,
It is still internal, but for consistency it might be better to add "_ca" to the name of this function too, as we now pass it a "ca" instead of an "istate".