git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GSoC][PATCH 0/4] t7401: modernize, cleanup and warn
@ 2020-07-26 14:25 Shourya Shukla
  2020-07-26 14:25 ` [PATCH 1/4] t7401: modernize style Shourya Shukla
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Shourya Shukla @ 2020-07-26 14:25 UTC (permalink / raw)
  To: git; +Cc: gitster, Johannes.Schindelin, peff, Shourya Shukla

Greetings,

The current phase of my GSoC project involves porting
'git submodule summary' from shell to C. While doing so, I, along with
my mentors Christian and Kaartic noticed some discrepancies in the test
script when trying to add a couple of tests to it. Though the test works
perfectly for my C port of 'summary', there were some unexpected behaviours
when trying to some tests to it. This patch series addresses these
issues in the test script by modernizing it, cleaning it up and warning
about some other issues.

Chiefly about patch 4/4 (t7401: add a WARNING and a NEEDSWORK),
when trying to write a test for verifying the summary output of
deinitialized submodule, doing a 'git submodule deinit <path>' did not
bear any fruit since the submodule never really got deinitialized. 
The deinit documentation states that:

	Unregister the given submodules, i.e. remove the whole
	submodule.$name section from .git/config together with
	their work tree.

Something which was not actually happening in the test. It appeared
that the reason for the deinit issue is that the test script uses
'git add' to add submodules instead of the command 'git submodule add'.

This behaviour also prompted the need to design a new test script to
have a testing of some niche cases such as those stated before, but
this is something that will be covered in the patch series responsible
for porting the 'summary' subcommand to C.

Comments and reviews are appreciated.

Thanks,
Shourya Shukla

Shourya Shukla (4):
  t7401: modernize style
  t7401: change test_i18ncmp syntax for clarity
  t7401: ensure uniformity in the '--for-status' test
  t7401: add a WARNING and a NEEDSWORK

 t/t7401-submodule-summary.sh | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] t7401: modernize style
  2020-07-26 14:25 [GSoC][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
@ 2020-07-26 14:25 ` Shourya Shukla
  2020-07-26 14:25 ` [PATCH 2/4] t7401: change test_i18ncmp syntax for clarity Shourya Shukla
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Shourya Shukla @ 2020-07-26 14:25 UTC (permalink / raw)
  To: git
  Cc: gitster, Johannes.Schindelin, peff, Shourya Shukla,
	Christian Couder, Kaartic Sivaraam

The tests in 't7401-submodule-summary.sh' were written a long time ago
and have some violations with respect to our CodingGuidelines such as
incorrect spacing in usages of the redirection operator and absence
of line feed between statements in case of the '|' (pipe) operator.
Update it to match the CodingGuidelines.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 t/t7401-submodule-summary.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 9bc841d085..4439fb7c17 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -16,12 +16,13 @@ add_file () {
 	owd=$(pwd)
 	cd "$sm"
 	for name; do
-		echo "$name" > "$name" &&
+		echo "$name" >"$name" &&
 		git add "$name" &&
 		test_tick &&
 		git commit -m "Add $name"
 	done >/dev/null
-	git rev-parse --verify HEAD | cut -c1-7
+	git rev-parse --verify HEAD |
+	cut -c1-7
 	cd "$owd"
 }
 commit_file () {
@@ -125,7 +126,8 @@ commit_file sm1 &&
 head3=$(
 	cd sm1 &&
 	git reset --hard HEAD~2 >/dev/null &&
-	git rev-parse --verify HEAD | cut -c1-7
+	git rev-parse --verify HEAD |
+	cut -c1-7
 )
 
 test_expect_success 'modified submodule(backward)' "
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] t7401: change test_i18ncmp syntax for clarity
  2020-07-26 14:25 [GSoC][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
  2020-07-26 14:25 ` [PATCH 1/4] t7401: modernize style Shourya Shukla
@ 2020-07-26 14:25 ` Shourya Shukla
  2020-07-26 14:25 ` [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test Shourya Shukla
  2020-07-26 14:25 ` [PATCH 4/4] t7401: add a WARNING and a NEEDSWORK Shourya Shukla
  3 siblings, 0 replies; 12+ messages in thread
From: Shourya Shukla @ 2020-07-26 14:25 UTC (permalink / raw)
  To: git
  Cc: gitster, Johannes.Schindelin, peff, Shourya Shukla,
	Christian Couder, Kaartic Sivaraam

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.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 t/t7401-submodule-summary.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 4439fb7c17..18fefdb0ba 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -183,7 +183,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --cached' "
   < Add foo5
 
 EOF
-	test_i18ncmp actual expected
+	test_i18ncmp expected actual
 "
 
 test_expect_success 'typechanged submodule(submodule->blob), --files' "
@@ -193,7 +193,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --files' "
   > Add foo5
 
 EOF
-	test_i18ncmp actual expected
+	test_i18ncmp expected actual
 "
 
 rm -rf sm1 &&
@@ -204,7 +204,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' "
 * sm1 $head4(submodule)->$head5(blob):
 
 EOF
-	test_i18ncmp actual expected
+	test_i18ncmp expected actual
 "
 
 rm -f sm1 &&
@@ -217,7 +217,7 @@ test_expect_success 'nonexistent commit' "
   Warn: sm1 doesn't contain commit $head4_full
 
 EOF
-	test_i18ncmp actual expected
+	test_i18ncmp expected actual
 "
 
 commit_file
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-07-26 14:25 [GSoC][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
  2020-07-26 14:25 ` [PATCH 1/4] t7401: modernize style Shourya Shukla
  2020-07-26 14:25 ` [PATCH 2/4] t7401: change test_i18ncmp syntax for clarity Shourya Shukla
@ 2020-07-26 14:25 ` Shourya Shukla
  2020-07-26 14:25 ` [PATCH 4/4] t7401: add a WARNING and a NEEDSWORK Shourya Shukla
  3 siblings, 0 replies; 12+ messages in thread
From: Shourya Shukla @ 2020-07-26 14:25 UTC (permalink / raw)
  To: git
  Cc: gitster, Johannes.Schindelin, peff, Shourya Shukla,
	Christian Couder, Kaartic Sivaraam

The '--for-status' test got its expected output from stdin. This is
inconsistent with the other tests in the test script which get their
expected output from a file named 'expected'.

So, change the syntax of the '--for-status' test for uniformity.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 t/t7401-submodule-summary.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 18fefdb0ba..145914cd5a 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -285,13 +285,14 @@ EOF
 
 test_expect_success '--for-status' "
 	git submodule summary --for-status HEAD^ >actual &&
-	test_i18ncmp actual - <<EOF
+	cat >expected <<-EOF &&
 * sm1 $head6...0000000:
 
 * sm2 0000000...$head7 (2):
   > Add foo9
 
 EOF
+	test_i18ncmp expected actual
 "
 
 test_expect_success 'fail when using --files together with --cached' "
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] t7401: add a WARNING and a NEEDSWORK
  2020-07-26 14:25 [GSoC][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
                   ` (2 preceding siblings ...)
  2020-07-26 14:25 ` [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test Shourya Shukla
@ 2020-07-26 14:25 ` Shourya Shukla
  3 siblings, 0 replies; 12+ messages in thread
From: Shourya Shukla @ 2020-07-26 14:25 UTC (permalink / raw)
  To: git
  Cc: gitster, Johannes.Schindelin, peff, Shourya Shukla,
	Christian Couder, Kaartic Sivaraam

Add a WARNING regarding the usage of 'git add' instead of 'git
submodule add' to add submodules to the superproject. Also add a
NEEDSWORK regarding the outdated syntax and working of the test, which
may need to be improved to obtain better and desired results.

While at it, change the word 'test' to 'test script' in the test
description to avoid ambiguity.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 t/t7401-submodule-summary.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 145914cd5a..2db4cf5cbf 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -5,8 +5,13 @@
 
 test_description='Summary support for submodules
 
-This test tries to verify the sanity of summary subcommand of git submodule.
+This test script tries to verify the sanity of summary subcommand of git submodule.
 '
+# WARNING: This test script uses 'git add' instead of 'git submodule add' to add
+# submodules to the superproject. Some submodule subcommands such as init and
+# deinit might not work as expected in this script.
+
+# NEEDSWORK: This test script is old fashioned and may need a big cleanup.
 
 . ./test-lib.sh
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-06  8:50     ` Shourya Shukla
@ 2020-08-06 17:18       ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2020-08-06 17:18 UTC (permalink / raw)
  To: Shourya Shukla
  Cc: git, christian.couder, kaartic.sivaraam, johannes.schindelin,
	chriscool, liu.denton, me

Shourya Shukla <shouryashukla.oo@gmail.com> writes:

> On 05/08 02:30, Junio C Hamano wrote:
>> Shourya Shukla <shouryashukla.oo@gmail.com> writes:
>> 
>> > The '--for-status' test got its expected output from stdin. This is
>> > inconsistent with the other tests in the test script which get their
>> > expected output from a file named 'expected'.
>> >
>> > So, change the syntax of the '--for-status' test for uniformity.
>> 
>> There are a handful examples in t5401 and another one in t3700 that
>> give the "golden master" from the standard input.  When the expected
>> output is used only once, I do not think it is particularlly bad to
>> have it this way.  So,... meh?
>
> I realised what you were trying to say after checking out t5400 and
> t3700. I understand that this change may not be immediately needed but I
> think it does make reading the diff a bit easier since having a '-' as a
> file name does get a bit confusing when reading the output. 

If so, perhaps justifying the change based on that, not on
"consistency", would be a good idea.

        Side note: But would that mean you'd find it "confusing" to
        read output from 3700 and 5400?  Would "test writers should
        get used to it" be a workable alternative solution?

Since "test_cmp expect actual" and "test_cmp - actual <<HERE" are
_both_ valid forms that are useful for different situations, I do
not see a compelling reason to insist on one form is consistently
used and ban the use of the other.

So...

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-05 21:30   ` Junio C Hamano
@ 2020-08-06  8:50     ` Shourya Shukla
  2020-08-06 17:18       ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Shourya Shukla @ 2020-08-06  8:50 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, christian.couder, kaartic.sivaraam, johannes.schindelin,
	chriscool, liu.denton, me

On 05/08 02:30, Junio C Hamano wrote:
> Shourya Shukla <shouryashukla.oo@gmail.com> writes:
> 
> > The '--for-status' test got its expected output from stdin. This is
> > inconsistent with the other tests in the test script which get their
> > expected output from a file named 'expected'.
> >
> > So, change the syntax of the '--for-status' test for uniformity.
> 
> There are a handful examples in t5401 and another one in t3700 that
> give the "golden master" from the standard input.  When the expected
> output is used only once, I do not think it is particularlly bad to
> have it this way.  So,... meh?

I realised what you were trying to say after checking out t5400 and
t3700. I understand that this change may not be immediately needed but I
think it does make reading the diff a bit easier since having a '-' as a
file name does get a bit confusing when reading the output. If a
separeate commit just for this change is a problem then I can squash
this with the previous commit? What do you think?

> Unless there is a compelling reason to insist both are files
> (that may make it easier to enhance test_cmp in a certain way
> you plan to, for example), that is.
> 
> > Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> > Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
> > Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
> > ---
> >  t/t7401-submodule-summary.sh | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
> > index 18fefdb0ba..145914cd5a 100755
> > --- a/t/t7401-submodule-summary.sh
> > +++ b/t/t7401-submodule-summary.sh
> > @@ -285,13 +285,14 @@ EOF
> >  
> >  test_expect_success '--for-status' "
> >  	git submodule summary --for-status HEAD^ >actual &&
> > -	test_i18ncmp actual - <<EOF
> > +	cat >expected <<-EOF &&
> >  * sm1 $head6...0000000:
> >  
> >  * sm2 0000000...$head7 (2):
> >    > Add foo9
> >  
> >  EOF
> > +	test_i18ncmp expected actual
> >  "
> >  
> >  test_expect_success 'fail when using --files together with --cached' "

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-05 22:25     ` Junio C Hamano
@ 2020-08-05 22:26       ` Taylor Blau
  0 siblings, 0 replies; 12+ messages in thread
From: Taylor Blau @ 2020-08-05 22:26 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Taylor Blau, Shourya Shukla, git, christian.couder,
	kaartic.sivaraam, johannes.schindelin, liu.denton,
	Christian Couder

On Wed, Aug 05, 2020 at 03:25:17PM -0700, Junio C Hamano wrote:
> Taylor Blau <me@ttaylorr.com> writes:
>
> >>  test_expect_success '--for-status' "
> >>  	git submodule summary --for-status HEAD^ >actual &&
> >> -	test_i18ncmp actual - <<EOF
> >> +	cat >expected <<-EOF &&
> >>  * sm1 $head6...0000000:
> >>
> >>  * sm2 0000000...$head7 (2):
> >>    > Add foo9
> >>
> >>  EOF
> >> +	test_i18ncmp expected actual
> >>  "
> >
> > I think that this is on the right track, but you can use a '<<-\EOF'
> > here instead of '<<-EOF' to make the tabulation a little more flexible.
>
> You are correct that the patch could have indented the here-doc and
> the line with EOF with a tab to make it easier to read.
>
> The leading '-' after '<<' is what controls tabulation, so <<-EOF as
> written in the patch is good enough; you do not want to quote it
> further, because $head6 wants to be interpolated.

Ah, I never actually knew the difference between those two (and
apparently had been too lazy to look it up myself). Thanks for the
clarification.

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-05 21:01   ` Taylor Blau
@ 2020-08-05 22:25     ` Junio C Hamano
  2020-08-05 22:26       ` Taylor Blau
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2020-08-05 22:25 UTC (permalink / raw)
  To: Taylor Blau
  Cc: Shourya Shukla, git, christian.couder, kaartic.sivaraam,
	johannes.schindelin, liu.denton, Christian Couder

Taylor Blau <me@ttaylorr.com> writes:

>>  test_expect_success '--for-status' "
>>  	git submodule summary --for-status HEAD^ >actual &&
>> -	test_i18ncmp actual - <<EOF
>> +	cat >expected <<-EOF &&
>>  * sm1 $head6...0000000:
>>
>>  * sm2 0000000...$head7 (2):
>>    > Add foo9
>>
>>  EOF
>> +	test_i18ncmp expected actual
>>  "
>
> I think that this is on the right track, but you can use a '<<-\EOF'
> here instead of '<<-EOF' to make the tabulation a little more flexible.

You are correct that the patch could have indented the here-doc and
the line with EOF with a tab to make it easier to read.

The leading '-' after '<<' is what controls tabulation, so <<-EOF as
written in the patch is good enough; you do not want to quote it
further, because $head6 wants to be interpolated.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-05 17:49 ` [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test Shourya Shukla
  2020-08-05 21:01   ` Taylor Blau
@ 2020-08-05 21:30   ` Junio C Hamano
  2020-08-06  8:50     ` Shourya Shukla
  1 sibling, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2020-08-05 21:30 UTC (permalink / raw)
  To: Shourya Shukla
  Cc: git, christian.couder, kaartic.sivaraam, johannes.schindelin,
	liu.denton, Christian Couder

Shourya Shukla <shouryashukla.oo@gmail.com> writes:

> The '--for-status' test got its expected output from stdin. This is
> inconsistent with the other tests in the test script which get their
> expected output from a file named 'expected'.
>
> So, change the syntax of the '--for-status' test for uniformity.

There are a handful examples in t5401 and another one in t3700 that
give the "golden master" from the standard input.  When the expected
output is used only once, I do not think it is particularlly bad to
have it this way.  So,... meh?

Unless there is a compelling reason to insist both are files
(that may make it easier to enhance test_cmp in a certain way
you plan to, for example), that is.

> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
> ---
>  t/t7401-submodule-summary.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
> index 18fefdb0ba..145914cd5a 100755
> --- a/t/t7401-submodule-summary.sh
> +++ b/t/t7401-submodule-summary.sh
> @@ -285,13 +285,14 @@ EOF
>  
>  test_expect_success '--for-status' "
>  	git submodule summary --for-status HEAD^ >actual &&
> -	test_i18ncmp actual - <<EOF
> +	cat >expected <<-EOF &&
>  * sm1 $head6...0000000:
>  
>  * sm2 0000000...$head7 (2):
>    > Add foo9
>  
>  EOF
> +	test_i18ncmp expected actual
>  "
>  
>  test_expect_success 'fail when using --files together with --cached' "

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-05 17:49 ` [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test Shourya Shukla
@ 2020-08-05 21:01   ` Taylor Blau
  2020-08-05 22:25     ` Junio C Hamano
  2020-08-05 21:30   ` Junio C Hamano
  1 sibling, 1 reply; 12+ messages in thread
From: Taylor Blau @ 2020-08-05 21:01 UTC (permalink / raw)
  To: Shourya Shukla
  Cc: git, gitster, christian.couder, kaartic.sivaraam,
	johannes.schindelin, liu.denton, Christian Couder

On Wed, Aug 05, 2020 at 11:19:20PM +0530, Shourya Shukla wrote:
> The '--for-status' test got its expected output from stdin. This is
> inconsistent with the other tests in the test script which get their
> expected output from a file named 'expected'.
>
> So, change the syntax of the '--for-status' test for uniformity.

... serves me right for not reading the whole thread before responding
to the previous patch ;).

On a technical note, I don't think this is different enough from the
previous patch that they couldn't be combined. (A good indicator of this
is that I expected this change to be included in 2/4 and was surprised
that it was a separate step afterwords).

> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
> ---
>  t/t7401-submodule-summary.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
> index 18fefdb0ba..145914cd5a 100755
> --- a/t/t7401-submodule-summary.sh
> +++ b/t/t7401-submodule-summary.sh
> @@ -285,13 +285,14 @@ EOF
>
>  test_expect_success '--for-status' "
>  	git submodule summary --for-status HEAD^ >actual &&
> -	test_i18ncmp actual - <<EOF
> +	cat >expected <<-EOF &&
>  * sm1 $head6...0000000:
>
>  * sm2 0000000...$head7 (2):
>    > Add foo9
>
>  EOF
> +	test_i18ncmp expected actual
>  "

I think that this is on the right track, but you can use a '<<-\EOF'
here instead of '<<-EOF' to make the tabulation a little more flexible.

>
>  test_expect_success 'fail when using --files together with --cached' "
> --
> 2.27.0

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test
  2020-08-05 17:49 [GSoC][RESEND][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
@ 2020-08-05 17:49 ` Shourya Shukla
  2020-08-05 21:01   ` Taylor Blau
  2020-08-05 21:30   ` Junio C Hamano
  0 siblings, 2 replies; 12+ messages in thread
From: Shourya Shukla @ 2020-08-05 17:49 UTC (permalink / raw)
  To: git
  Cc: gitster, christian.couder, kaartic.sivaraam, johannes.schindelin,
	liu.denton, Shourya Shukla, Christian Couder

The '--for-status' test got its expected output from stdin. This is
inconsistent with the other tests in the test script which get their
expected output from a file named 'expected'.

So, change the syntax of the '--for-status' test for uniformity.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 t/t7401-submodule-summary.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 18fefdb0ba..145914cd5a 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -285,13 +285,14 @@ EOF
 
 test_expect_success '--for-status' "
 	git submodule summary --for-status HEAD^ >actual &&
-	test_i18ncmp actual - <<EOF
+	cat >expected <<-EOF &&
 * sm1 $head6...0000000:
 
 * sm2 0000000...$head7 (2):
   > Add foo9
 
 EOF
+	test_i18ncmp expected actual
 "
 
 test_expect_success 'fail when using --files together with --cached' "
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-06 17:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 14:25 [GSoC][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
2020-07-26 14:25 ` [PATCH 1/4] t7401: modernize style Shourya Shukla
2020-07-26 14:25 ` [PATCH 2/4] t7401: change test_i18ncmp syntax for clarity Shourya Shukla
2020-07-26 14:25 ` [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test Shourya Shukla
2020-07-26 14:25 ` [PATCH 4/4] t7401: add a WARNING and a NEEDSWORK Shourya Shukla
2020-08-05 17:49 [GSoC][RESEND][PATCH 0/4] t7401: modernize, cleanup and warn Shourya Shukla
2020-08-05 17:49 ` [PATCH 3/4] t7401: ensure uniformity in the '--for-status' test Shourya Shukla
2020-08-05 21:01   ` Taylor Blau
2020-08-05 22:25     ` Junio C Hamano
2020-08-05 22:26       ` Taylor Blau
2020-08-05 21:30   ` Junio C Hamano
2020-08-06  8:50     ` Shourya Shukla
2020-08-06 17:18       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).