git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [GSoC][PATCH v3 0/5] t7401: modernize, cleanup and more
@ 2020-08-21 16:59 Shourya Shukla
  2020-08-21 16:59 ` [PATCH v3 1/5] t7401: modernize style Shourya Shukla
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Shourya Shukla @ 2020-08-21 16:59 UTC (permalink / raw)
  To: git
  Cc: gitster, christian.couder, Johannes.Schindelin, kaartic.sivaraam,
	liu.denton, me, Shourya Shukla

Greetings,
The is the v3 of the previously posted patch series with the same title:
https://lore.kernel.org/git/20200812192737.13971-1-shouryashukla.oo@gmail.com/

After suggestions from Junio and Kaartic I made some changes:

-> In 0f7f1d3f9a (t7401: modernize style, 2020-07-23)), Kaartic advised
   to use a '--short' instead of '--verify', which will remove the call
   to 'cut' since '--short' is the name as '--verify' and on top of that
   shortens the hash as per our need. Thus, deliver this change as a
   separate commit 2c7afd6147 (t7401: use 'short' instead of 'verify'
   and cut in rev-parse calls, 2020-08-14).

-> In 948c85f637 (t7401: use 'short' instead of 'verify' and cut in
   rev-parse calls, 2020-08-14), transfer the heredoc limiter change to
   7c227a2d47 (t7401: change indentation for enhanced readability,
   2020-08-11) since it is more apt there. This was suggested by Junio.

-> 7c227a2d47 (t7401: change indentation for enhanced readability,
   2020-08-11), improve the commit message and account for the heredoc
   change which was transferred to this commit from the previous one.

-> Although not suggested by anyone, but I also improved the NEEDSWORK
   in 313c04e197 (t7401: add a NEEDSWORK, 2020-07-23) to make it more
   precise.

Feedback and reviews are appreciated. I am tagging along a range-diff
between the v1 and v2 for ease of review.

Regards,
Shourya Shukla

-----
range-diff:

1:  2939804509 ! 1:  0f7f1d3f9a t7401: modernize style
    @@ Commit message
         The tests in 't7401-submodule-summary.sh' were written a long time ago
         and has a violation with respect to our CodingGuidelines which is,
         incorrect spacing in usages of the redirection operator.
    -    Using a Git command in the upstream of a pipe might result in us
    -    losing its exit code. So, convert such usages so that they write to
    -    a file and read from them.
     
         Mentored-by: Christian Couder <chriscool@tuxfamily.org>
         Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    @@ t/t7401-submodule-summary.sh: add_file () {
                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 >out &&
    -+  cut -c1-7 out
    -   cd "$owd"
    - }
    - commit_file () {
    -@@ t/t7401-submodule-summary.sh: 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 >out &&
    -+  cut -c1-7 out
    - )
    - 
    - test_expect_success 'modified submodule(backward)' "
-:  ---------- > 2:  948c85f637 t7401: use 'short' instead of 'verify' and cut in rev-parse calls
2:  00c6289d5e ! 3:  f5548fe7c6 t7401: change test_i18ncmp syntax for clarity
    @@ Metadata
     Author: Shourya Shukla <shouryashukla.oo@gmail.com>
     
      ## Commit message ##
    -    t7401: change test_i18ncmp syntax for clarity
    +    t7401: change syntax of test_i18ncmp calls for clarity
     
         Change the test_i18ncmp syntax from 'test_i18ncmp actual expected' to
         'test_i18ncmp expected actual' to align it with the convention followed
    @@ t/t7401-submodule-summary.sh: EOF
      test_expect_success '--for-status' "
        git submodule summary --for-status HEAD^ >actual &&
     -  test_i18ncmp actual - <<EOF
    -+  test_i18ncmp - actual <<-EOF
    ++  test_i18ncmp - actual <<EOF
      * sm1 $head6...0000000:
      
      * sm2 0000000...$head7 (2):
3:  f0b87ddaf6 ! 4:  7c227a2d47 t7401: change indentation for enhanced readability
    @@ Commit message
         t7401: change indentation for enhanced readability
     
         Change the indentation of expected outputs for enhanced readability of
    -    the tests.
    +    the tests. Also modify the heredoc string limiter in a test which lacks
    +    it to support the indentation change.
     
         Mentored-by: Christian Couder <chriscool@tuxfamily.org>
         Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    @@ t/t7401-submodule-summary.sh: commit_file sm2
      
      test_expect_success '--for-status' "
        git submodule summary --for-status HEAD^ >actual &&
    -   test_i18ncmp - actual <<-EOF
    +-  test_i18ncmp - actual <<EOF
     -* sm1 $head6...0000000:
    ++  test_i18ncmp - actual <<-EOF
     +  * sm1 $head6...0000000:
      
     -* sm2 0000000...$head7 (2):
4:  a743c28d71 ! 5:  313c04e197 t7401: add a NEEDSWORK
    @@ t/t7401-submodule-summary.sh
     -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.
      '
    -+# NEEDSWORK: This test script is old fashioned and may need a big cleanup since
    -+# there are lots of commands taking place outside of 'test_expect_success'
    -+# block, which is no longer in good-style.
    ++# NEEDSWORK: This test script is old fashioned and may need a big cleanup due to
    ++# various reasons, one of them being that there are lots of commands taking place
    ++# outside of 'test_expect_success' block, which is no longer in good-style.
      
      . ./test-lib.sh

-----

Shourya Shukla (5):
  t7401: modernize style
  t7401: use 'short' instead of 'verify' and cut in rev-parse calls
  t7401: change syntax of test_i18ncmp calls for clarity
  t7401: change indentation for enhanced readability
  t7401: add a NEEDSWORK

 t/t7401-submodule-summary.sh | 149 ++++++++++++++++++-----------------
 1 file changed, 76 insertions(+), 73 deletions(-)

-- 
2.28.0


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 16:59 [GSoC][PATCH v3 0/5] t7401: modernize, cleanup and more Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 1/5] t7401: modernize style Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 2/5] t7401: use 'short' instead of 'verify' and cut in rev-parse calls Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 3/5] t7401: change syntax of test_i18ncmp calls for clarity Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 4/5] t7401: change indentation for enhanced readability Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 5/5] t7401: add a NEEDSWORK Shourya Shukla

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).