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

[PATCH v3 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes

From
Usman Akinyemi via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 6, 2024, 16:06 UTC
Message-ID
<pull.1805.v3.git.git.1728230769.gitgitgadget@gmail.com>
In-Reply-To
<pull.1805.v2.git.git.1728203495287.gitgitgadget@gmail.com>

At the beginning of my task, I made the mistake of submitting two patches for two separate commits instead of one. The first patch addressed the issue of losing the Git exit status due to pipes.

After submitting the first patch, I noticed that the output of wc -l was failing due to trailing whitespace. I attempted to fix this by using tr -d to remove the whitespace. However, instead of squashing the two patches into one, I inadvertently created another commit.

Eric Sunshine sunshine@sunshineco.com provided valuable feedback during the review process. He explained the details of the patches to me and pointed out that using tr -d was unnecessary to resolve the whitespace issue.

The root cause of the whitespace issue was quoting $count in the test command, which led to the inclusion of whitespace in the comparison. By removing the quotes around $count, the comparison works as expected without the need for tr -d.

Signed-off-by: Usman Akinyemi
Usman Akinyemi (2):
  t3404: avoid losing exit status with focus on `git show` and `git
    cat-files`
  [Outreachy][Patch v1] t3404: employing test_line_count() to replace
    test
 t/t3404-rebase-interactive.sh | 74 +++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 24 deletions(-)
base-commit: 90fe3800b92a49173530828c0a17951abd30f0e1
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1805%2FUnique-Usman%2Favoid_git_pipes-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1805/Unique-Usman/avoid_git_pipes-v3
Pull-Request: https://github.com/git/git/pull/1805
Range-diff vs v2:
 1:  be5a691e96f ! 1:  c9a0cca179b [Outreachy][Patch v1] t3404: avoid losing exit status to pipes
     @@ Metadata
      Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
      
       ## Commit message ##
     -    [Outreachy][Patch v1] t3404: avoid losing exit status to pipes
     +    t3404: avoid losing exit status with focus on `git show` and `git cat-files`
      
          The exit code of the preceding command in a pipe is disregarded. So
          if that preceding command is a Git command that fails, the test would
          not fail. Instead, by saving the output of that Git command to a file,
          and removing the pipe, we make sure the test will fail if that Git
     -    command fails.
     +    command fails. This particular patch focuses on some of the instances
     +    which include `git show` and `git cat-files`.
      
          Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
      
 -:  ----------- > 2:  37b1411ee2c [Outreachy][Patch v1] t3404: employing test_line_count() to replace test
-- 
gitgitgadget
Previous: Eric SunshineNext: Usman Akinyemi via GitGitGadget
Message 23 of 63 in “t3404: avoid losing exit status to pipes”
  1. 0/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 6, 2024
  2. 1/2 [Outreachy][Patch v1] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 6, 2024
  3. Eric SunshineOct 6, 2024
  4. Usman AkinyemiOct 6, 2024
  5. 2/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 6, 2024
  6. Eric SunshineOct 6, 2024
  7. Usman AkinyemiOct 6, 2024
  8. Eric SunshineOct 6, 2024
  9. Usman AkinyemiOct 6, 2024
  10. [Outreachy][Patch v1] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 6, 2024
  11. Eric SunshineOct 6, 2024
  12. Usman AkinyemiOct 6, 2024
  13. Eric SunshineOct 6, 2024
  14. shejialuoOct 6, 2024
  15. Eric SunshineOct 6, 2024
  16. Usman AkinyemiOct 6, 2024
  17. shejialuoOct 6, 2024
  18. Usman AkinyemiOct 6, 2024
  19. shejialuoOct 6, 2024
  20. shejialuoOct 6, 2024
  21. Usman AkinyemiOct 6, 2024
  22. Eric SunshineOct 7, 2024
  23. 0/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 6, 2024
  24. 1/2 t3404: avoid losing exit status with focus on `git show` and `git cat-files`Usman Akinyemi via GitGitGadget, Oct 6, 2024
  25. Patrick SteinhardtOct 7, 2024
  26. phillip.wood123@gmail.comOct 7, 2024
  27. Usman AkinyemiOct 7, 2024
  28. 2/2 [Outreachy][Patch v1] t3404: employing test_line_count() to replace testUsman Akinyemi via GitGitGadget, Oct 6, 2024
  29. Kristoffer HaugsbakkOct 6, 2024
  30. Eric SunshineOct 7, 2024
  31. Patrick SteinhardtOct 7, 2024
  32. Usman AkinyemiOct 7, 2024
  33. phillip.wood123@gmail.comOct 7, 2024
  34. Usman AkinyemiOct 6, 2024
  35. Eric SunshineOct 7, 2024
  36. Usman AkinyemiOct 7, 2024
  37. Patrick SteinhardtOct 7, 2024
  38. Eric SunshineOct 7, 2024
  39. Usman AkinyemiOct 7, 2024
  40. Kristoffer HaugsbakkOct 6, 2024
  41. Usman AkinyemiOct 6, 2024
  42. Patrick SteinhardtOct 7, 2024
  43. 0/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 7, 2024
  44. 1/2 t3404: avoid losing exit status with focus on `git show` and `git cat-file`Usman Akinyemi via GitGitGadget, Oct 7, 2024
  45. 2/2 [Outreachy][Patch v1] t3404: employing test_line_count() to replace testUsman Akinyemi via GitGitGadget, Oct 7, 2024
  46. Patrick SteinhardtOct 7, 2024
  47. 0/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 7, 2024
  48. 1/2 t3404: avoid losing exit status with focus on `git show` and `git cat-file`Usman Akinyemi via GitGitGadget, Oct 7, 2024
  49. 2/2 t3404: employing test_line_count() to replace testUsman Akinyemi via GitGitGadget, Oct 7, 2024
  50. Patrick SteinhardtOct 7, 2024
  51. Usman AkinyemiOct 7, 2024
  52. 0/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 7, 2024
  53. 1/2 t3404: avoid losing exit status with focus on `git show` and `git cat-file`Usman Akinyemi via GitGitGadget, Oct 7, 2024
  54. 2/2 t3404: employing test_line_count() to replace testUsman Akinyemi via GitGitGadget, Oct 7, 2024
  55. Phillip WoodOct 7, 2024
  56. Usman AkinyemiOct 7, 2024
  57. Patrick SteinhardtOct 7, 2024
  58. Usman AkinyemiOct 7, 2024
  59. Patrick SteinhardtOct 7, 2024
  60. Usman AkinyemiOct 7, 2024
  61. 0/2 [Outreachy][Patch v2] t3404: avoid losing exit status to pipesUsman Akinyemi via GitGitGadget, Oct 7, 2024
  62. 1/2 t3404: avoid losing exit status with focus on `git show` and `git cat-file`Usman Akinyemi via GitGitGadget, Oct 7, 2024
  63. 2/2 t3404: replace test with test_line_count()Usman Akinyemi via GitGitGadget, Oct 7, 2024

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.