git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/3] modernize style

From
Shuqi Liang <cheskaqiqi@gmail.com>
Date
Feb 5, 2023, 14:52 UTC
Message-ID
<20230205145245.11078-1-cheskaqiqi@gmail.com>
In-Reply-To
<20230202171821.10508-1-cheskaqiqi@gmail.com>
different between V2:
1.change the commit massage in t4113: Modernize test script and t4113: indent with space.
2. Put the executable lines inside the test_expect_success.Mention the new style problem cause 
by this change,which is change the "<<" to "<<-" to strip leading TABs used for indentation.
Shuqi Liang (3):
  t/t4113-apply-ending.sh: Modernize test script
  t4113: put executable lines to test_expect_success
  t4113: indent with space
 t/t4113-apply-ending.sh | 79 ++++++++++++++++++++---------------------
 1 file changed, 38 insertions(+), 41 deletions(-)
Range-diff against v2:
1:  d7d52f1f79 ! 1:  3d40bcce13 t/t4113-apply-ending.sh: Modernize a test script
    @@ Metadata
     Author: Shuqi Liang <cheskaqiqi@gmail.com>
     
      ## Commit message ##
    -    t/t4113-apply-ending.sh: Modernize a test script
    +    t/t4113-apply-ending.sh: Modernize test script
     
    +    Test scripts in file in this script are written in old style,
    +    where the test_expect_success command and test title are written on
    +    separate lines. Change the old style to modern style.
    +
    +    for example :
    +    -test_expect_success setup \
    +    -    'git update-index --add file'
    +    -
    +    +test_expect_success setup '
    +    +    git update-index --add file
    +    +'
         Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com>
     
      ## t/t4113-apply-ending.sh ##
2:  d9e5a54e32 ! 2:  5c55b208a8 Test scripts in file t4113-apply-ending.sh, files "test-patch" and "file" are created twice.
    @@ Metadata
     Author: Shuqi Liang <cheskaqiqi@gmail.com>
     
      ## Commit message ##
    -    Test scripts in file t4113-apply-ending.sh, files
    -    "test-patch" and "file" are created twice.
    +    t4113: put executable lines to test_expect_success
     
    -    Make the second creation of the files its own step
    -    'setup for apply at the beginning'.
    +    This script is written in old style,where there are
    +    some executable lines outside test_expect_success. Put the executable
    +    lines inside the test_expect_success.
    +
    +    As t/README says,use "<<-" instead of "<<"
    +    to strip leading TABs used for indentation. change the "<<" to "<<-"
    +
    +    for example:
    +    -cat >test-patch <<\EOF
    +    -diff a/file b/file
    +
    +     test_expect_success 'apply at the beginning' '
    +    +       cat >test-patch <<-\EOF
    +    +       diff a/file b/file
    +    +       --- a/file
     
         Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com>
     
    @@ t/t4113-apply-ending.sh: test_description='git apply trying to add an ending lin
      
     -# setup
     -
    - cat >test-patch <<\EOF
    - diff --git a/file b/file
    - --- a/file
    -@@ t/t4113-apply-ending.sh: echo 'c' >>file
    +-cat >test-patch <<\EOF
    +-diff --git a/file b/file
    +---- a/file
    +-+++ b/file
    +-@@ -1,2 +1,3 @@
    +- a
    +- b
    +-+c
    +-EOF
    +-
    +-echo 'a' >file
    +-echo 'b' >>file
    +-echo 'c' >>file
    +-
      test_expect_success setup '
    ++	cat >test-patch <<-\EOF
    ++	diff --git a/file b/file
    ++	--- a/file
    ++	+++ b/file
    ++	@@ -1,2 +1,3 @@
    ++	a
    ++	b
    ++	+c
    ++	EOF
    ++
    ++	echo 'a' >file
    ++	echo 'b' >>file
    ++	echo 'c' >>file
          git update-index --add file
      '
     -# test
    @@ -1,2 +1,3 @@
     -b
     -c'
     -git update-index file
    -+test_expect_success 'setup for apply at the beginning' '
    -+	cat >test-patch <<\EOF
    +-
    + test_expect_success 'apply at the beginning' '
    ++	cat >test-patch <<-\EOF
     +	diff a/file b/file
     +	--- a/file
     +	+++ b/file
    @@ -1,2 +1,3 @@
     +	b
     +	c'
     +	git update-index file
    -+'
    - 
    - test_expect_success 'apply at the beginning' '
          test_must_fail git apply --index test-patch
    + '
    + 
3:  01a5c3285e < -:  ---------- use "<<-" instead of "<<"
4:  cf2b2ca5a0 < -:  ---------- t4113-apply-ending.sh used 4-column indent with space,fix it in use tabs for indentation.
-:  ---------- > 3:  02b661279f t4113: indent with space
-- 
2.39.0
Previous: Shuqi LiangNext: Shuqi Liang
Message 15 of 49 in “t/t4113-apply-ending.sh: Modernize a test script”
  1. Shuqi LiangJan 31, 2023
  2. Andrei RybakFeb 1, 2023
  3. cheska franFeb 2, 2023
  4. 0/4 t4113: modernize test styleShuqi Liang, Feb 2, 2023
  5. 1/4 t4113: replace backslash with single quoteShuqi Liang, Feb 2, 2023
  6. Junio C HamanoFeb 2, 2023
  7. Shuqi LiangFeb 5, 2023
  8. 2/4 t4113:put second creation in own stepShuqi Liang, Feb 2, 2023
  9. 3/4 t4113: use "<<-" instead of "<<"Shuqi Liang, Feb 2, 2023
  10. Junio C HamanoFeb 2, 2023
  11. Shuqi LiangFeb 5, 2023
  12. 4/4 t4113: indent with tabsShuqi Liang, Feb 2, 2023
  13. Junio C HamanoFeb 2, 2023
  14. Shuqi LiangFeb 5, 2023
  15. 0/3 modernize styleShuqi Liang, Feb 5, 2023
  16. 1/3 t4113: modernize a test scriptShuqi Liang, Feb 5, 2023
  17. 2/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 5, 2023
  18. 3/3 t4113: indent with spaceShuqi Liang, Feb 5, 2023
  19. Eric SunshineFeb 5, 2023
  20. Shuqi LiangFeb 6, 2023
  21. 0/3 t4113: modernize styleShuqi Liang, Feb 6, 2023
  22. 1/3 t4113: modernize test scriptShuqi Liang, Feb 6, 2023
  23. 2/3 t4113: indent with tabShuqi Liang, Feb 6, 2023
  24. 3/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 6, 2023
  25. Ævar Arnfjörð BjarmasonFeb 6, 2023
  26. Junio C HamanoFeb 6, 2023
  27. Shuqi LiangFeb 6, 2023
  28. Ævar Arnfjörð BjarmasonFeb 7, 2023
  29. Shuqi LiangFeb 7, 2023
  30. Shuqi LiangFeb 8, 2023
  31. Ævar Arnfjörð BjarmasonFeb 8, 2023
  32. Shuqi LiangFeb 10, 2023
  33. Eric SunshineFeb 15, 2023
  34. Eric SunshineFeb 15, 2023
  35. Shuqi LiangFeb 14, 2023
  36. Junio C HamanoFeb 14, 2023
  37. 0/3 t4113: modernize styleShuqi Liang, Feb 9, 2023
  38. 1/3 t4113: modernize test scriptShuqi Liang, Feb 9, 2023
  39. 2/3 t4113: indent with tabShuqi Liang, Feb 9, 2023
  40. Eric SunshineFeb 15, 2023
  41. Shuqi LiangFeb 15, 2023
  42. 3/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 9, 2023
  43. Eric SunshineFeb 15, 2023
  44. Shuqi LiangFeb 15, 2023
  45. 0/3 t4113: modernize styleShuqi Liang, Feb 15, 2023
  46. 0/3 t4113: modernize styleShuqi Liang, Feb 15, 2023
  47. 1/3 t4113: modernize test scriptShuqi Liang, Feb 15, 2023
  48. 2/3 t4113: indent with tabShuqi Liang, Feb 15, 2023
  49. 3/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 15, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.