public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Torsten Bögershausen" <tboegi@web•de>
Cc: git@vger•kernel.org
Subject: Re: [PATCH/RFC v2] Set core.precomposeunicode to true on e.g. HFS+
Date: Tue, 27 Aug 2013 07:33:16 -0700	[thread overview]
Message-ID: <xmqqzjs3fbkj.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <201308271550.41448.tboegi@web.de> ("Torsten Bögershausen"'s message of "Tue, 27 Aug 2013 15:50:40 +0200")

Torsten Bögershausen <tboegi@web•de> writes:

> When core.precomposeunicode was introduced in 76759c7d,
> it was set to false on a unicode decomposing file system like HFS+
> to be compatible with older versions of Git.
>
> The Mac OS users need to find out that this configuration exist
> and change it manually from false to true.

Yeah, I think this makes sense.

I actually wonder why we thought that the way 76759c7d (git on Mac
OS and precomposed unicode, 2012-07-08) did "add the variable to the
config but do not enable" was a good idea.  If I recall correctly,
the justification was "that way the users will not be suddenly
affected by the behaviour change, but can notice an unfamiliar
variable in their configuration and flip it as needed"; I said that
it did not make sense to me ($gmane/188940) back then and now I
think with this patch we are in agreement ;-).

> -		/* Indicate to the user, that we can configure it to true */
> -		if (!access(path, R_OK))
> -			git_config_set("core.precomposeunicode", "false");
> -		/* To be backward compatible, set precomposed_unicode to 0 */
> -		precomposed_unicode = 0;
> +		precomposed_unicode = access(path, R_OK) ? 0 : 1;
> +		git_config_set("core.precomposeunicode", precomposed_unicode ? "true" : "false");

This test is very conservative in that only a successful access()
will flip the bit; I like it.

Will queue.  Thanks.

>  		strcpy(path + len, auml_nfc);
>  		if (unlink(path))
>  			die_errno(_("failed to unlink '%s'"), path);
> diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
> index 05d78d2..6b3cedc 100755
> --- a/t/t0050-filesystem.sh
> +++ b/t/t0050-filesystem.sh
> @@ -91,6 +91,7 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
>  test_expect_success "setup unicode normalization tests" '
>  	test_create_repo unicode &&
>  	cd unicode &&
> +	git config core.precomposeunicode false &&
>  	touch "$aumlcdiar" &&
>  	git add "$aumlcdiar" &&
>  	git commit -m initial &&
> diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
> index 5fe57c5..e4ba601 100755
> --- a/t/t3910-mac-os-precompose.sh
> +++ b/t/t3910-mac-os-precompose.sh
> @@ -36,7 +36,7 @@ Alongc=$Alongc$AEligatu$AEligatu                     #254 Byte
>  
>  test_expect_success "detect if nfd needed" '
>  	precomposeunicode=`git config core.precomposeunicode` &&
> -	test "$precomposeunicode" = false &&
> +	test "$precomposeunicode" = true &&
>  	git config core.precomposeunicode true
>  '
>  test_expect_success "setup" '
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index 5ee97b0..f0f8cde 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -958,7 +958,6 @@ test_expect_success 'submodule with UTF-8 name' '
>  		git add sub &&
>  		git commit -m "init sub"
>  	) &&
> -	test_config core.precomposeunicode true &&
>  	git submodule add ./"$svname" &&
>  	git submodule >&2 &&
>  	test -n "$(git submodule | grep "$svname")"

      reply	other threads:[~2013-08-27 14:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27 13:50 [PATCH/RFC v2] Set core.precomposeunicode to true on e.g. HFS+ Torsten Bögershausen
2013-08-27 14:33 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqzjs3fbkj.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=tboegi@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox