Re: [PATCH v3 2/3] ref-filter: handle CRLF at end-of-line more gracefully

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

 



Hi Junio,

> Le 12 oct. 2020 à 18:24, Junio C Hamano <gitster@xxxxxxxxx> a écrit :
> 
> "Philippe Blain via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:
> 
>> -	for (i = 0; i < len; i++)
>> -		if (r[i] == '\n')
>> -			r[i] = ' ';
>> +	for (int i = 0; i < len; i++) {
> 
> We do not allow this in our codebase (yet).
> 
> cf. Documentation/CodingGuidelines
> 
> - Declaring a variable in the for loop "for (int i = 0; i < 10; i++)"
>   is still not allowed in this codebase.

Indeed. Will fix (and re-read the guidelines).

> 
>> diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
>> index 71818b90f0..c06eca774f 100755
>> --- a/t/t3203-branch-output.sh
>> +++ b/t/t3203-branch-output.sh
>> @@ -3,13 +3,11 @@
>> test_description='git branch display tests'
>> . ./test-lib.sh
>> . "$TEST_DIRECTORY"/lib-terminal.sh
>> +. "$TEST_DIRECTORY"/lib-crlf-messages.sh
>> 
>> test_expect_success 'make commits' '
>> -	echo content >file &&
>> -	git add file &&
>> -	git commit -m one &&
>> -	echo content >>file &&
>> -	git commit -a -m two
>> +	test_commit one &&
>> +	test_commit two
>> '
> 
> What does this change have to do with the topic at hand?

In the previous iteration, the expected output of one of the tests
I was adding had commit hashes, 
so the change above was necessary to make those hashes reproducible.
However in this series I removed the hashes from the expected output
because it would break the "linux-clang" CI job which runs with SHA-256.

Maybe we should add a note in t/README specifically saying that raw commit
hashes should not appear in expected output, but use $(git rev-parse "${ref}")
instead ? Could this be a preparatory patch, or would deserve a separate topic ?





[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