Re: [PATCH v3 01/19] convert: make convert_attrs() and convert structs public

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 29, 2020 at 8:40 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Matheus Tavares <matheus.bernardino@xxxxxx> writes:
>
> > diff --git a/convert.h b/convert.h
> > index e29d1026a6..aeb4a1be9a 100644
> > --- a/convert.h
> > +++ b/convert.h
> > @@ -37,6 +37,27 @@ enum eol {
> >  #endif
> >  };
> >
> > +enum crlf_action {
> > +     CRLF_UNDEFINED,
> > +     CRLF_BINARY,
> > +     CRLF_TEXT,
> > +     CRLF_TEXT_INPUT,
> > +     CRLF_TEXT_CRLF,
> > +     CRLF_AUTO,
> > +     CRLF_AUTO_INPUT,
> > +     CRLF_AUTO_CRLF
> > +};
> > +
> > +struct convert_driver;
> > +
> > +struct conv_attrs {
> > +     struct convert_driver *drv;
> > +     enum crlf_action attr_action; /* What attr says */
> > +     enum crlf_action crlf_action; /* When no attr is set, use core.autocrlf */
> > +     int ident;
> > +     const char *working_tree_encoding; /* Supported encoding or default encoding if NULL */
> > +};
> > +
> >  enum ce_delay_state {
> >       CE_NO_DELAY = 0,
> >       CE_CAN_DELAY = 1,
> > @@ -102,6 +123,9 @@ void convert_to_git_filter_fd(const struct index_state *istate,
> >  int would_convert_to_git_filter_fd(const struct index_state *istate,
> >                                  const char *path);
> >
> > +void convert_attrs(const struct index_state *istate,
> > +                struct conv_attrs *ca, const char *path);
> > +
> >  /*
> >   * Initialize the checkout metadata with the given values.  Any argument may be
> >   * NULL if it is not applicable.  The treeish should be a commit if that is
>
> The new global symbols are reasonable, I would think, with a
> possible exception of "crlf_action", which may want to also have
> "conv" or "convert" somewhere in its name.

OK. Maybe `enum crlf_conv_action`? In this case, should I also change
the prefix of the enum values? I'm not sure if it's worth it, though,
since there are about 52 occurrences of them.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux