Subject: Re: [PATCH v2 2/4] t7401: change test_i18ncmp syntax for clarity

From: Shourya Shukla <[email-masked]>
Date: Fri, 14 Aug 2020 20:27:41 +0530

On 12/08 02:02, Junio C Hamano wrote:
> Junio C Hamano <[email-masked]> writes:
> 
> > Shourya Shukla <[email-masked]> writes:
> >
> >> Change the test_i18ncmp syntax from 'test_i18ncmp actual expected' to
> >> 'test_i18ncmp expected actual' to align it with the convention followed
> >> by other tests in the test script.
> >> ...
> >> @@ -285,7 +285,7 @@ EOF
> >>  
> >>  test_expect_success '--for-status' "
> >>  	git submodule summary --for-status HEAD^ >actual &&
> >> -	test_i18ncmp actual - <<EOF
> >> +	test_i18ncmp - actual <<-EOF
> >>  * sm1 $head6...0000000:
> >>  
> >>  * sm2 0000000...$head7 (2):
> >
> > This one does more than what the proposed log message explains, but
> > it does not do enough at the same time.  
> >
> > If "actual vs expected order" is what this commit wants to fix, then
> > "<<EOF" vs "<<-EOF" is outside the scope of it.
> >
> > Personally, I think it is a good idea to update the end-of-heredoc
> > marker to "<<-EOF", ...
> 
> It seems that the theme of your [3/4] is exactly about fixing the
> "end-of-heredoc marker is prefixed with dash, but the heredoc is not
> indented for readability", so perhaps you'd want to stop this step
> at turning the line to
> 
> >> -	test_i18ncmp actual - <<EOF
> >> +	test_i18ncmp - actual <<EOF
> 
> i.e. "compare expected vs actual in this order", and then in the
> next patch [3/4], edit the line further to
> 
> 	test_i18ncmp - actual <<-EOF
> 
> *and* indent the here-doc at the same time?

Ohh okay okay. I understand what you are saying. I wanted to fix the
heredoc markers and indent the tests for better readibility but actually
I fixed the heredoc marker in [2/4]. Therefore, the change in [2/4]
should in fact be:

    -	test_i18ncmp actual - <<EOF
    +	test_i18ncmp - actual <<EOF

And in this patch [3/4], it should become:

    -	test_i18ncmp - actual <<EOF
    +	test_i18ncmp - actual <<-EOF

As well as the indentation fixes I did in the patch already. Now I
understand the exact use and significance of the heredoc. Thank you.