Volume XXII, number 279Tuesday, October 6, 2026Latest message 43 minutes ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

patchsubmodule absorbgitdirs tests: use test_* helper functions

4 messages between Jun 30, 2026 and Jul 27, 2026, from Bryan B. Lima, Junio C Hamano, Patrick Steinhardt.

Plain Markdown or JSON for tools and agents. Diffs are folded; open one to read it.

Bryan B. LimaJun 30, 2026, 02:02 UTC on lore
Use modern helper functions from test-lib-functions.sh to provide nice error messages.
Signed-off-by: Bryan B. Lima <bblima@usp.br>
Co-authored-by: Gustavo S. Correa <gustavoscorrea@usp.br>
Signed-off-by: Gustavo S. Correa <gustavoscorrea@usp.br>
---
 t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
Show changes to t/t7412-submodule-absorbgitdirs.sh +11 −11
diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
index 0490499573..bd1c684480 100755
--- a/t/t7412-submodule-absorbgitdirs.sh
+++ b/t/t7412-submodule-absorbgitdirs.sh
@@ -34,8 +34,8 @@ test_expect_success 'absorb the git dir' '
 	git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
 	git fsck &&
-	test -f sub1/.git &&
-	test -d .git/modules/sub1 &&
+	test_path_is_file sub1/.git &&
+	test_path_is_dir .git/modules/sub1 &&
 	git status >actual.1 &&
 	git -C sub1 rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&
@@ -47,9 +47,9 @@ test_expect_success 'absorbing does not fail for deinitialized submodules' '
 	git submodule deinit --all &&
 	git submodule absorbgitdirs 2>err &&
 	test_must_be_empty err &&
-	test -d .git/modules/sub1 &&
-	test -d sub1 &&
-	! test -e sub1/.git
+	test_path_is_dir .git/modules/sub1 &&
+	test_path_is_dir sub1 &&
+	test_path_is_missing sub1/.git
 '
 
 test_expect_success 'setup nested submodule' '
@@ -72,8 +72,8 @@ test_expect_success 'absorb the git dir in a nested submodule' '
 	EOF
 	git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
-	test -f sub1/nested/.git &&
-	test -d .git/modules/sub1/modules/nested &&
+	test_path_is_file sub1/nested/.git &&
+	test_path_is_dir .git/modules/sub1/modules/nested &&
 	git status >actual.1 &&
 	git -C sub1/nested rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&
@@ -109,9 +109,9 @@ test_expect_success 'absorb the git dir in a nested submodule' '
 	EOF
 	git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
-	test -f sub1/.git &&
-	test -f sub1/nested/.git &&
-	test -d .git/modules/sub1/modules/nested &&
+	test_path_is_file sub1/.git &&
+	test_path_is_file sub1/nested/.git &&
+	test_path_is_dir .git/modules/sub1/modules/nested &&
 	git status >actual.1 &&
 	git -C sub1/nested rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&
@@ -155,7 +155,7 @@ test_expect_success 'absorbing the git dir fails for incomplete submodules' '
 	test_must_fail git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
 	git -C sub2 fsck &&
-	test -d sub2/.git &&
+	test_path_is_dir sub2/.git &&
 	git status >actual &&
 	git -C sub2 rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&

base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
-- 
2.54.0
Junio C HamanoJun 30, 2026, 18:00 UTC in reply to Bryan B. Lima on lore

Re: [PATCH] submodule absorbgitdirs tests: use test_* helper functions

"Bryan B. Lima" <bblima@usp.br> writes:
Show 8 quoted lines
> Use modern helper functions from test-lib-functions.sh to provide nice error messages.
>
> Signed-off-by: Bryan B. Lima <bblima@usp.br>
> Co-authored-by: Gustavo S. Correa <gustavoscorrea@usp.br>
> Signed-off-by: Gustavo S. Correa <gustavoscorrea@usp.br>
> ---
>  t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
Welcome to the Git development community.

It is rare, but it happens from time to time, that we see a patch by somebody we haven't seen on this list, and the patch looks perfect. Very delighted.

Will queue.  Thanks.
Show 63 quoted lines
> diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
> index 0490499573..bd1c684480 100755
> --- a/t/t7412-submodule-absorbgitdirs.sh
> +++ b/t/t7412-submodule-absorbgitdirs.sh
> @@ -34,8 +34,8 @@ test_expect_success 'absorb the git dir' '
>  	git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
>  	git fsck &&
> -	test -f sub1/.git &&
> -	test -d .git/modules/sub1 &&
> +	test_path_is_file sub1/.git &&
> +	test_path_is_dir .git/modules/sub1 &&
>  	git status >actual.1 &&
>  	git -C sub1 rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
> @@ -47,9 +47,9 @@ test_expect_success 'absorbing does not fail for deinitialized submodules' '
>  	git submodule deinit --all &&
>  	git submodule absorbgitdirs 2>err &&
>  	test_must_be_empty err &&
> -	test -d .git/modules/sub1 &&
> -	test -d sub1 &&
> -	! test -e sub1/.git
> +	test_path_is_dir .git/modules/sub1 &&
> +	test_path_is_dir sub1 &&
> +	test_path_is_missing sub1/.git
>  '
>  
>  test_expect_success 'setup nested submodule' '
> @@ -72,8 +72,8 @@ test_expect_success 'absorb the git dir in a nested submodule' '
>  	EOF
>  	git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
> -	test -f sub1/nested/.git &&
> -	test -d .git/modules/sub1/modules/nested &&
> +	test_path_is_file sub1/nested/.git &&
> +	test_path_is_dir .git/modules/sub1/modules/nested &&
>  	git status >actual.1 &&
>  	git -C sub1/nested rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
> @@ -109,9 +109,9 @@ test_expect_success 'absorb the git dir in a nested submodule' '
>  	EOF
>  	git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
> -	test -f sub1/.git &&
> -	test -f sub1/nested/.git &&
> -	test -d .git/modules/sub1/modules/nested &&
> +	test_path_is_file sub1/.git &&
> +	test_path_is_file sub1/nested/.git &&
> +	test_path_is_dir .git/modules/sub1/modules/nested &&
>  	git status >actual.1 &&
>  	git -C sub1/nested rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
> @@ -155,7 +155,7 @@ test_expect_success 'absorbing the git dir fails for incomplete submodules' '
>  	test_must_fail git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
>  	git -C sub2 fsck &&
> -	test -d sub2/.git &&
> +	test_path_is_dir sub2/.git &&
>  	git status >actual &&
>  	git -C sub2 rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
>
> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
Patrick SteinhardtJul 1, 2026, 08:04 UTC in reply to Junio C Hamano on lore

Re: [PATCH] submodule absorbgitdirs tests: use test_* helper functions

On Tue, Jun 30, 2026 at 11:00:28AM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> "Bryan B. Lima" <bblima@usp.br> writes:
> 
> > Use modern helper functions from test-lib-functions.sh to provide nice error messages.
> >
> > Signed-off-by: Bryan B. Lima <bblima@usp.br>
> > Co-authored-by: Gustavo S. Correa <gustavoscorrea@usp.br>
> > Signed-off-by: Gustavo S. Correa <gustavoscorrea@usp.br>
> > ---
> >  t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
> >  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> Welcome to the Git development community.
Welcome indeed!
> It is rare, but it happens from time to time, that we see a patch by
> somebody we haven't seen on this list, and the patch looks perfect.
> Very delighted.

Sorry to spoil it: the order of SOBs is incorrect. The patch is authored by Bryan, so that signoff needs to come last.

The patch itself looks good though, thanks!
Patrick
Junio C HamanoJul 27, 2026, 15:59 UTC in reply to Patrick Steinhardt on lore

Re: [PATCH] submodule absorbgitdirs tests: use test_* helper functions

Patrick Steinhardt <ps@pks.im> writes:
Show 24 quoted lines
> On Tue, Jun 30, 2026 at 11:00:28AM -0700, Junio C Hamano wrote:
>> "Bryan B. Lima" <bblima@usp.br> writes:
>> 
>> > Use modern helper functions from test-lib-functions.sh to provide nice error messages.
>> >
>> > Signed-off-by: Bryan B. Lima <bblima@usp.br>
>> > Co-authored-by: Gustavo S. Correa <gustavoscorrea@usp.br>
>> > Signed-off-by: Gustavo S. Correa <gustavoscorrea@usp.br>
>> > ---
>> >  t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
>> >  1 file changed, 11 insertions(+), 11 deletions(-)
>> 
>> Welcome to the Git development community.
>
> Welcome indeed!
>
>> It is rare, but it happens from time to time, that we see a patch by
>> somebody we haven't seen on this list, and the patch looks perfect.
>> Very delighted.
>
> Sorry to spoil it: the order of SOBs is incorrect. The patch is authored
> by Bryan, so that signoff needs to come last.
>
> The patch itself looks good though, thanks!

This discussion thread has been hanging for a while after we saw this message. To help a new participant, here are a few tips.

 * These discussions can be seen on mail archives.  On the primary
   archive, the message I am responding to appears here:
   https://lore.kernel.org/git/akTKHfKPsP3-Rn31@pks.im/
   For any discussion you are interested in, replace the URL path
   with the Message-Id of the message that is part of the
   discussion.  For example, after sending a patch, you use the
   message ID of the patch message you sent out and by visiting the
   page there, you see everything people said on your patch.
   https://lore.kernel.org/git/20260630020220.1559190-1-bblima@usp.br/
   Scroll down to see the "Thread overview".
 * When you receive a review response to help you polish your patch
   submission, you are expected to respond to it.  If the reviewer
   suggested an improvement, either you respond explaining why your
   original is better without the change suggested, or you respond
   thanking the reviewer for the suggestion and promise to submit an
   updated version that incorporates the suggested improvements, and
   then take your time to improve the patch and send a "reroll".
   For this patch, it would be numbered "v2".
   As we can see, neither option has occurred, and this discussion
   thread is keeping everybody waiting.
Thanks.

Back to recent threads