Subject: Re: [PATCH v3 25/30] t/test-lib-functions.sh: support `--date` in `test_commit_bulk()`

From: Junio C Hamano <[email-masked]>
Date: Thu, 23 May 2024 08:45:24 -0700

Jeff King <[email-masked]> writes:

> On Tue, May 21, 2024 at 03:02:59PM -0400, Taylor Blau wrote:
>
>> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
>> index 862d80c9748..16fd585e34b 100644
>> --- a/t/test-lib-functions.sh
>> +++ b/t/test-lib-functions.sh
>> @@ -458,6 +458,7 @@ test_commit_bulk () {
>>  	indir=.
>>  	ref=HEAD
>>  	n=1
>> +	notick=
>>  	message='commit %s'
>>  	filename='%s.t'
>>  	contents='content %s'
>> @@ -488,6 +489,12 @@ test_commit_bulk () {
>>  			filename="${1#--*=}-%s.t"
>>  			contents="${1#--*=} %s"
>>  			;;
>> +		--date)
>> +			notick=yes
>> +			GIT_COMMITTER_DATE="$2"
>> +			GIT_AUTHOR_DATE="$2"
>> +			shift
>> +			;;
>
> This gives all of the bulk commits the same date. Which is kind of
> unrealistic.

Yeah, giving this helper function a "--notick" option, without
adding this "--date" option, is a better design, I suspect.

The callers Taylor expected to use --date can set the _DATE
variables and pass "--notick", and callers that want the same
timestamp without caring which exact timestamp can just pass
"--notick" without futzing with _DATE variables.

Thanks.