git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] config.c: fix regression for core.safecrlf false

From
Torsten Bögershausen <tboegi@web.de>
Date
Jun 6, 2018, 15:53 UTC
Message-ID
<20180606155309.GA5624@atze2.lan>
In-Reply-To
<20180604201742.18992-1-asottile@umich.edu>
On Mon, Jun 04, 2018 at 01:17:42PM -0700, Anthony Sottile wrote:
Show 46 quoted lines
> A regression introduced in 8462ff43e42ab67cecd16fdfb59451a53cc8a945 caused
> autocrlf rewrites to produce a warning message despite setting safecrlf=false.
> 
> Signed-off-by: Anthony Sottile <asottile@umich.edu>
> ---
>  config.c        |  2 +-
>  t/t0020-crlf.sh | 10 ++++++++++
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/config.c b/config.c
> index fbbf0f8..de24e90 100644
> --- a/config.c
> +++ b/config.c
> @@ -1233,7 +1233,7 @@ static int git_default_core_config(const char *var, const char *value)
>  		}
>  		eol_rndtrp_die = git_config_bool(var, value);
>  		global_conv_flags_eol = eol_rndtrp_die ?
> -			CONV_EOL_RNDTRP_DIE : CONV_EOL_RNDTRP_WARN;
> +			CONV_EOL_RNDTRP_DIE : 0;
>  		return 0;
>  	}
>  
> diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
> index 71350e0..5f05698 100755
> --- a/t/t0020-crlf.sh
> +++ b/t/t0020-crlf.sh
> @@ -98,6 +98,16 @@ test_expect_success 'safecrlf: git diff demotes safecrlf=true to warn' '
>  '
>  
>  
> +test_expect_success 'safecrlf: no warning with safecrlf=false' '
> +	git config core.autocrlf input &&
> +	git config core.safecrlf false &&
> +
> +	for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
> +	git add allcrlf 2>err &&
> +	test_must_be_empty err
> +'
> +
> +
>  test_expect_success 'switch off autocrlf, safecrlf, reset HEAD' '
>  	git config core.autocrlf false &&
>  	git config core.safecrlf false &&
> -- 
> 2.7.4
> 
Looks good to me, thanks for cleaning my mess.
Acked-By: Torsten Bögershausen <tboegi@web.de>
Previous: Anthony SottileNext: Eric Sunshine
Message 2 of 9 in “config.c: fix regression for core.safecrlf false”
  1. config.c: fix regression for core.safecrlf falseAnthony Sottile, Jun 4, 2018
  2. Torsten BögershausenJun 6, 2018
  3. Eric SunshineJun 6, 2018
  4. Eric SunshineJun 6, 2018
  5. Anthony SottileJun 6, 2018
  6. Eric SunshineJun 6, 2018
  7. Anthony SottileJun 12, 2018
  8. Eric SunshineJun 12, 2018
  9. Torsten BögershausenJun 13, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.