Re: [PATCH v4 3/8] t3900: demonstrate git-rebase problem with multi encoding

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

 



On Thu, Nov 07, 2019 at 09:56:14AM +0700, Doan Tran Cong Danh wrote:

> We're using fixup!/squash! <subject> to mark if current commit will be
> used to be fixed up or squashed to a previous commit.
> 
> However, if we're changing i18n.commitencoding after making the
> original commit but before making the fixing up, we couldn't find the
> original commit to do the fixup/squash.
> 
> Add a test to demonstrate that problem.

OK, this makes sense to do.

I'm not sure if we need to test so many combinations, as the problem is
apparent even on some vanilla ones. But I guess this is just following
the lead of the rest of the script.

> +test_commit_autosquash_multi_encoding () {
> +	flag=$1
> +	old=$2
> +	new=$3
> +	msg=$4
> +	test_expect_failure "commit --$flag into $old from $new" '
> +		git checkout -b '$flag-$old-$new' C0 &&

These single quotes are funny; they close the test-snippet string, so
these variables are outside of any quoting (and thus subject to
whitespace splitting).

The test snippets are run as an eval, so they have access to the
variables you set above. I.e., just:

  git checkout -b $flag-$old-$new C0

would work. Or:

  git checkout -b "$flag-$old-$new" C0

if you wanted to be more careful inside the snippet.

> +		git config i18n.commitencoding '$old' &&
> +		echo '$old' >>F &&
> +		git commit -a -F "$TEST_DIRECTORY/t3900/'$msg'" &&

Likewise for all these other bits of the script.

-Peff



[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