Re: [PATCH v3 01/19] convert: make convert_attrs() and convert structs public
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2020, 23:40 UTC
- Message-ID
- <xmqq361w4n4x.fsf@gitster.c.googlers.com>
- In-Reply-To
- <dfc3e0fd62bcf0223dc51485521116e1aca2ee07.1603937110.git.matheus.bernardino@usp.br>
Matheus Tavares <matheus.bernardino@usp.br> writes:
Show 42 quoted lines
> 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 isThe 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.