Re: [PATCH v3 2/3] ref-filter: handle CRLF at end-of-line more gracefully
- From
Philippe Blain <levraiphilippeblain@gmail.com>
- Date
- Oct 14, 2020, 13:09 UTC
- Message-ID
- <1902E2D2-5265-48BC-877F-21B6C2D201B1@gmail.com>
- In-Reply-To
- <xmqqh7qzm6ai.fsf@gitster.c.googlers.com>
Hi Junio,
Show 15 quoted lines
> Le 12 oct. 2020 à 18:24, Junio C Hamano <gitster@pobox.com> a écrit :
>
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> 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).
Show 22 quoted lines
> >> 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 ?