From: Junio C Hamano <gitster@pobox.com>
To: "Mark C. Chu-Carroll" <markchucarroll@fastmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3 1/3] Update t/t4001-diff-rename.sh to modern style.
Date: Fri, 18 Sep 2026 00:10:51 -0700 [thread overview]
Message-ID: <xmqqjyojowzo.fsf@gitster.g> (raw)
In-Reply-To: <20260917195436.1102981-2-markchucarroll@fastmail.com> (Mark C. Chu-Carroll's message of "Thu, 17 Sep 2026 15:54:34 -0400")
"Mark C. Chu-Carroll" <markchucarroll@fastmail.com> writes:
> Subject: Re: [PATCH v3 1/3] Update t/t4001-diff-rename.sh to modern style.
Documentation/SubmittingPatches::[[summary-section]]
Perhaps
Subject: [PATCH v3 1/3] t4001: modernize
> Old tests were written in a different style than modern
> ones; for better readability and test error messages,
> update t4001 to the modern style.
That is a laudable goal, but enumerate the rules you followed to
achieve that goal. For example, a few of them may have been
* Run everything inside test_expect_success block.
* Write the title on the same line as test_expect_success and end
that line with a singul quote that opens the body of the test; a
line with a sole single quote then closes the body.
> Signed-off-by: Mark C. Chu-Carroll <markchucarroll@fastmail.com>
> ---
> -test_expect_success 'setup' '
> +initial_setup () {
Why a shell function that is called only once by a test titled "Diff
shows path0 ..." below? It is customary to perform the setup in the
very first test_expect_success whose title is 'setup'. I doubt it
would contribute to better readability to change that.
> -test_expect_success 'test diff.renames=true' '
> +test_expect_success 'With diff.renames=true, patch includes rename of path0 to path1' '
> -test_expect_success 'test diff.renames=false' '
> +test_expect_success 'With diff.renames=false, patch does not include rename' '
> ...
>
> -test_expect_success 'favour same basenames even with minor differences' '
> +test_expect_success 'rename logic favours same basenames even with minor differences' '
Here you are failing to follow your own renaming rules to start test
titles in uppercase letters. I personally wouldn't have chosen to
upcase many of them; rather, the majority of tests in this file seem
to be named in lowercase so I would have instead made sure I'd start
them in lowercase as well. In any case, please be consistent.
> -test_expect_success 'setup for many rename source candidates' '
> +test_expect_success 'rename with many candidates' '
> git reset --hard &&
> for i in 0 1 2 3 4 5 6 7 8 9;
> do
> @@ -177,14 +166,14 @@ test_expect_success 'setup for many rename source candidates' '
> done
> done &&
> git add "path??" &&
> - test_tick &&
> + test_tick &&
Good eyes ;-).
> -test_expect_success 'rename pretty print with common prefix' '
> +test_expect_success 'rename pretty prints paths with common prefix' '
Meh.
Neither way, it is grammatical at all 'rename' may not be plural, so
the verb 'print' may want 's' for third-person-singular, but it does
not make sense to use 'rename' as the subject for "pretty-print"
anyway. It is not that 'rename' is the one that prints something.
next prev parent reply other threads:[~2026-09-18 7:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 19:54 [PATCH v3 0/3] Update t40* tests to use modern style Mark C. Chu-Carroll
2026-09-17 19:54 ` [PATCH v3 1/3] Update t/t4001-diff-rename.sh to " Mark C. Chu-Carroll
2026-09-18 7:10 ` Junio C Hamano [this message]
2026-09-18 14:54 ` Mark C. Chu-Carroll
2026-09-17 19:54 ` [PATCH v3 2/3] Update t/t4009-diff-rename-4 to use " Mark C. Chu-Carroll
2026-09-17 19:54 ` [PATCH v3 3/3] Update t/t4010-diff-pathspec.sh to " Mark C. Chu-Carroll
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=xmqqjyojowzo.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=markchucarroll@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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