diff mbox series

[RFC,v3,3/7] t/clar: fix whitespace errors

Message ID 35682b7686e570a96a8432f6b8af1996ab8d748e.1723095269.git.ps@pks.im (mailing list archive)
State Superseded
Headers show
Series Introduce clar testing framework | expand

Commit Message

Patrick Steinhardt Aug. 8, 2024, 5:38 a.m. UTC
Fix whitespace errors in the clar that make git-apply(1) unhappy. This
has been cherry-picked from the upstream pull request at [1].

[1]: https://github.com/clar-test/clar/pull/97

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/unit-tests/clar/clar/sandbox.h  | 5 ++---
 t/unit-tests/clar/generate.py     | 1 -
 t/unit-tests/clar/test/.gitignore | 1 -
 3 files changed, 2 insertions(+), 5 deletions(-)

Comments

Junio C Hamano Aug. 13, 2024, 3:25 p.m. UTC | #1
Patrick Steinhardt <ps@pks.im> writes:

> Fix whitespace errors in the clar that make git-apply(1) unhappy. This
> has been cherry-picked from the upstream pull request at [1].
>
> [1]: https://github.com/clar-test/clar/pull/97
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  t/unit-tests/clar/clar/sandbox.h  | 5 ++---
>  t/unit-tests/clar/generate.py     | 1 -
>  t/unit-tests/clar/test/.gitignore | 1 -
>  3 files changed, 2 insertions(+), 5 deletions(-)

A funny thing about this step is that the copy I carried for the
past few days was an empty patch, because out of habit I use the
"--whitespace=fix" option while running "git am".  As that fixes
the whitespace breakage this step addresses while applying the
previous step, this one becomes empty.

I'll requeue these patches with --whitespace=warn instead.

Thanks.
Randall S. Becker Aug. 13, 2024, 3:31 p.m. UTC | #2
On Tuesday, August 13, 2024 11:26 AM, Junio C Hamano wrote:
>Patrick Steinhardt <ps@pks.im> writes:
>
>> Fix whitespace errors in the clar that make git-apply(1) unhappy. This
>> has been cherry-picked from the upstream pull request at [1].
>>
>> [1]: https://github.com/clar-test/clar/pull/97
>>
>> Signed-off-by: Patrick Steinhardt <ps@pks.im>
>> ---
>>  t/unit-tests/clar/clar/sandbox.h  | 5 ++---
>>  t/unit-tests/clar/generate.py     | 1 -
>>  t/unit-tests/clar/test/.gitignore | 1 -
>>  3 files changed, 2 insertions(+), 5 deletions(-)
>
>A funny thing about this step is that the copy I carried for the past few days was an
>empty patch, because out of habit I use the "--whitespace=fix" option while running
>"git am".  As that fixes the whitespace breakage this step addresses while applying
>the previous step, this one becomes empty.
>
>I'll requeue these patches with --whitespace=warn instead.

Please forgive the third ask, but I really want to test the build early. Suggestions?
Junio C Hamano Aug. 13, 2024, 6:43 p.m. UTC | #3
<rsbecker@nexbridge.com> writes:

> On Tuesday, August 13, 2024 11:26 AM, Junio C Hamano wrote:
>>Patrick Steinhardt <ps@pks.im> writes:
>>
>>> Fix whitespace errors in the clar that make git-apply(1) unhappy. This
>>> has been cherry-picked from the upstream pull request at [1].
>>>
>>> [1]: https://github.com/clar-test/clar/pull/97
>>>
>>> Signed-off-by: Patrick Steinhardt <ps@pks.im>
>>> ---
>>>  t/unit-tests/clar/clar/sandbox.h  | 5 ++---
>>>  t/unit-tests/clar/generate.py     | 1 -
>>>  t/unit-tests/clar/test/.gitignore | 1 -
>>>  3 files changed, 2 insertions(+), 5 deletions(-)
>>
>>A funny thing about this step is that the copy I carried for the past few days was an
>>empty patch, because out of habit I use the "--whitespace=fix" option while running
>>"git am".  As that fixes the whitespace breakage this step addresses while applying
>>the previous step, this one becomes empty.
>>
>>I'll requeue these patches with --whitespace=warn instead.
>
> Please forgive the third ask, but I really want to test the build early. Suggestions?

Sorry, but I do not follow.  If you have "git am" and "git clone"
working, and if you have enough C toolchain to build the rest of
Git, wouldn't it be sufficient to also build this addition?  I think
the 7 patches cleanly apply to any recent tip of 'master'.
Randall S. Becker Aug. 13, 2024, 7:14 p.m. UTC | #4
On Tuesday, August 13, 2024 2:44 PM, Junio C Hamano wrote:
><rsbecker@nexbridge.com> writes:
>
>> On Tuesday, August 13, 2024 11:26 AM, Junio C Hamano wrote:
>>>Patrick Steinhardt <ps@pks.im> writes:
>>>
>>>> Fix whitespace errors in the clar that make git-apply(1) unhappy.
>>>> This has been cherry-picked from the upstream pull request at [1].
>>>>
>>>> [1]: https://github.com/clar-test/clar/pull/97
>>>>
>>>> Signed-off-by: Patrick Steinhardt <ps@pks.im>
>>>> ---
>>>>  t/unit-tests/clar/clar/sandbox.h  | 5 ++---
>>>>  t/unit-tests/clar/generate.py     | 1 -
>>>>  t/unit-tests/clar/test/.gitignore | 1 -
>>>>  3 files changed, 2 insertions(+), 5 deletions(-)
>>>
>>>A funny thing about this step is that the copy I carried for the past
>>>few days was an empty patch, because out of habit I use the
>>>"--whitespace=fix" option while running "git am".  As that fixes the
>>>whitespace breakage this step addresses while applying the previous step, this
>one becomes empty.
>>>
>>>I'll requeue these patches with --whitespace=warn instead.
>>
>> Please forgive the third ask, but I really want to test the build early. Suggestions?
>
>Sorry, but I do not follow.  If you have "git am" and "git clone"
>working, and if you have enough C toolchain to build the rest of Git, wouldn't it be
>sufficient to also build this addition?  I think the 7 patches cleanly apply to any
>recent tip of 'master'.

I am confused. My bad. The unit test works fine with the custom clar off seen and next.
Junio C Hamano Aug. 13, 2024, 8:42 p.m. UTC | #5
Junio C Hamano <gitster@pobox.com> writes:

> Patrick Steinhardt <ps@pks.im> writes:
>
>> Fix whitespace errors in the clar that make git-apply(1) unhappy. This
>> has been cherry-picked from the upstream pull request at [1].
>>
>> [1]: https://github.com/clar-test/clar/pull/97
>>
>> Signed-off-by: Patrick Steinhardt <ps@pks.im>
>> ---
>>  t/unit-tests/clar/clar/sandbox.h  | 5 ++---
>>  t/unit-tests/clar/generate.py     | 1 -
>>  t/unit-tests/clar/test/.gitignore | 1 -
>>  3 files changed, 2 insertions(+), 5 deletions(-)
>
> A funny thing about this step is that the copy I carried for the
> past few days was an empty patch, because out of habit I use the
> "--whitespace=fix" option while running "git am".  As that fixes
> the whitespace breakage this step addresses while applying the
> previous step, this one becomes empty.
>
> I'll requeue these patches with --whitespace=warn instead.

Oops, it turns out that this is insufficient.  I'll add the
following as a separate patch immediately after this step.

Thanks.

 t/unit-tests/clar/clar/fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git c/t/unit-tests/clar/clar/fs.h w/t/unit-tests/clar/clar/fs.h
index a6eda5e5dc..3e39890bd3 100644
--- c/t/unit-tests/clar/clar/fs.h
+++ w/t/unit-tests/clar/clar/fs.h
@@ -146,7 +146,7 @@ fs_rm_wait(WCHAR *_wpath)
 			ERROR_PATH_NOT_FOUND == last_error)
 			return 0;
 
-		Sleep(RM_RETRY_DELAY * retries * retries);	
+		Sleep(RM_RETRY_DELAY * retries * retries);
 	}
 	while (retries++ <= RM_RETRY_COUNT);
Patrick Steinhardt Aug. 14, 2024, 5:58 a.m. UTC | #6
On Tue, Aug 13, 2024 at 01:42:08PM -0700, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Patrick Steinhardt <ps@pks.im> writes:
> >
> >> Fix whitespace errors in the clar that make git-apply(1) unhappy. This
> >> has been cherry-picked from the upstream pull request at [1].
> >>
> >> [1]: https://github.com/clar-test/clar/pull/97
> >>
> >> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> >> ---
> >>  t/unit-tests/clar/clar/sandbox.h  | 5 ++---
> >>  t/unit-tests/clar/generate.py     | 1 -
> >>  t/unit-tests/clar/test/.gitignore | 1 -
> >>  3 files changed, 2 insertions(+), 5 deletions(-)
> >
> > A funny thing about this step is that the copy I carried for the
> > past few days was an empty patch, because out of habit I use the
> > "--whitespace=fix" option while running "git am".  As that fixes
> > the whitespace breakage this step addresses while applying the
> > previous step, this one becomes empty.
> >
> > I'll requeue these patches with --whitespace=warn instead.
> 
> Oops, it turns out that this is insufficient.  I'll add the
> following as a separate patch immediately after this step.
> 
> Thanks.
> 
>  t/unit-tests/clar/clar/fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git c/t/unit-tests/clar/clar/fs.h w/t/unit-tests/clar/clar/fs.h
> index a6eda5e5dc..3e39890bd3 100644
> --- c/t/unit-tests/clar/clar/fs.h
> +++ w/t/unit-tests/clar/clar/fs.h
> @@ -146,7 +146,7 @@ fs_rm_wait(WCHAR *_wpath)
>  			ERROR_PATH_NOT_FOUND == last_error)
>  			return 0;
>  
> -		Sleep(RM_RETRY_DELAY * retries * retries);	
> +		Sleep(RM_RETRY_DELAY * retries * retries);
>  	}
>  	while (retries++ <= RM_RETRY_COUNT);

Ah, didn't notice that one, thanks. I've also updated the upstream pull
request accordingly.

Patrick
diff mbox series

Patch

diff --git a/t/unit-tests/clar/clar/sandbox.h b/t/unit-tests/clar/clar/sandbox.h
index 0ba1479620..7c177f3525 100644
--- a/t/unit-tests/clar/clar/sandbox.h
+++ b/t/unit-tests/clar/clar/sandbox.h
@@ -25,9 +25,9 @@  find_tmp_path(char *buffer, size_t length)
 	static const size_t var_count = 5;
 	static const char *env_vars[] = {
 		"CLAR_TMP", "TMPDIR", "TMP", "TEMP", "USERPROFILE"
- 	};
+	};
 
- 	size_t i;
+	size_t i;
 
 	for (i = 0; i < var_count; ++i) {
 		const char *env = getenv(env_vars[i]);
@@ -151,4 +151,3 @@  const char *clar_sandbox_path(void)
 {
 	return _clar_path;
 }
-
diff --git a/t/unit-tests/clar/generate.py b/t/unit-tests/clar/generate.py
index 931b4d60d9..80996ac3e7 100755
--- a/t/unit-tests/clar/generate.py
+++ b/t/unit-tests/clar/generate.py
@@ -264,4 +264,3 @@  def write(self):
     suite.disable(options.excluded)
     if suite.write():
         print("Written `clar.suite` (%d tests in %d suites)" % (suite.callback_count(), suite.suite_count()))
-
diff --git a/t/unit-tests/clar/test/.gitignore b/t/unit-tests/clar/test/.gitignore
index 3e8ae0a3a5..a477d0c40c 100644
--- a/t/unit-tests/clar/test/.gitignore
+++ b/t/unit-tests/clar/test/.gitignore
@@ -2,4 +2,3 @@  clar.suite
 .clarcache
 clar_test
 *.o
-