Re: [PATCH v4 01/19] convert: make convert_attrs() and convert structs public
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- Dec 5, 2020, 21:53 UTC
- Message-ID
- <CAHd-oW6RNVP68gXHGsMS9ky+DdcRBbTxJt--TRNszi9v+xOh-Q@mail.gmail.com>
- In-Reply-To
- <CAP8UFD0Z-EU0=9qz8wYt4MSFqqmoDKnMxTbqgUJNVOR+qUZ3rA@mail.gmail.com>
On Sat, Dec 5, 2020 at 7:40 AM Christian Couder <christian.couder@gmail.com> wrote:
Show 21 quoted lines
> > On Wed, Nov 4, 2020 at 9:33 PM Matheus Tavares > <matheus.bernardino@usp.br> wrote: > > > > From: Jeff Hostetler <jeffhost@microsoft.com> > > > > Move convert_attrs() declaration from convert.c to convert.h, together > > with the conv_attrs struct and the crlf_action enum. This function and > > the data structures will be used outside convert.c in the upcoming > > parallel checkout implementation. Note that crlf_action is renamed to > > convert_crlf_action, which is more appropriate for the global namespace. > > It annoys me a bit that some things are called "conv_*" and others > "convert_*". Maybe we could standardize everything, but it could be a > separate patch series. > > > Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> > > [matheus.bernardino: squash and reword msg] > > Not sure we want the above line, which could actually not be > completely true if you rework the patch before it gets merged.
Right, I'll remove this line from this and the next patches. Thanks.
Show 20 quoted lines
> > Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
>
> > --- a/convert.h
> > +++ b/convert.h
> > @@ -63,6 +63,30 @@ struct checkout_metadata {
> > struct object_id blob;
> > };
> >
> > +enum convert_crlf_action {
> > + CRLF_UNDEFINED,
> > + CRLF_BINARY,
> > + CRLF_TEXT,
> > + CRLF_TEXT_INPUT,
> > + CRLF_TEXT_CRLF,
> > + CRLF_AUTO,
> > + CRLF_AUTO_INPUT,
> > + CRLF_AUTO_CRLF
> > +};
>
> Maybe we should also prepend "CONVERT_" to the values?Yeah, I also wondered about that. But I wasn't sure if it was worth the change since there are about 52 occurrences of them. Junio later mentioned [1] that it might be OK to leave them as-is since the use sites will always pass these values to the API functions, which would make it clear that they are from the "convert_" family.
[1]: https://lore.kernel.org/git/xmqqd00z397m.fsf@gitster.c.googlers.com/