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

Re: [PATCH 4/4] t4014: add tests to cover --resend option and its exclusivity

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 17, 2024, 06:48 UTC
Message-ID
<CAPig+cRBjosyadQHO03fcCz7YBc=T04ytHkpt9UU87tLaiSOgw@mail.gmail.com>
In-Reply-To
<42865d6c6694b9e6b745c328d717ed244dc25a1a.1713324598.git.dsimic@manjaro.org>
On Tue, Apr 16, 2024 at 11:33 PM Dragan Simic <dsimic@manjaro.org> wrote:
> Add a few new tests to the t4014 that cover the --resend command-line option
> for "git format-patch", which include the tests for its exclusivity with the
> already existing -k and --rfc command-line options.

I'd recommend squashing this patch into [3/4] which introduces the --resend option since it's easier to review the tests when the code which is being tested is still fresh in one's mind. (For the same reason, reviewers like to see documentation added in the same patch which changes the code since it's easier to verify that the documentation matches the implementation while it's fresh in the mind.)

Show 8 quoted lines
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
> @@ -1401,6 +1401,43 @@ test_expect_success '--rfc and -k cannot be used together' '
> +test_expect_success '--resend' '
> +       cat >expect <<-\EOF &&
> +       Subject: [PATCH RESEND 1/1] header with . in it
> +       EOF

In all of the new tests, since it's just a single line body, it could just as easily be created with `echo`:

    echo "Subject: [PATCH RESEND 1/1] header with . in it" >expect &&

On the other hand, if you're following precedent in this script, then using a here-doc may be just fine.

At any rate it's somewhat subjective and not worth a reroll.
> +       git format-patch -n -1 --stdout --resend >patch &&
> +       grep "^Subject:" patch >actual &&
> +       test_cmp expect actual
> +'
Previous: Dragan SimicNext: Dragan Simic
Message 17 of 51 in “format-patch: fix an option coexistence bug and add new --resend option”
  1. 0/4 format-patch: fix an option coexistence bug and add new --resend optionDragan Simic, Apr 17, 2024
  2. 1/4 format-patch docs: avoid use of parentheses to improve readabilityDragan Simic, Apr 17, 2024
  3. 2/4 format-patch: fix a bug in option exclusivity and add a test to t4014Dragan Simic, Apr 17, 2024
  4. Eric SunshineApr 17, 2024
  5. Dragan SimicApr 17, 2024
  6. Patrick SteinhardtApr 17, 2024
  7. Dragan SimicApr 17, 2024
  8. Dragan SimicApr 18, 2024
  9. Kristoffer HaugsbakkApr 17, 2024
  10. Eric SunshineApr 17, 2024
  11. Dragan SimicApr 17, 2024
  12. Kristoffer HaugsbakkApr 17, 2024
  13. Dragan SimicApr 17, 2024
  14. Dragan SimicApr 17, 2024
  15. Dragan SimicApr 17, 2024
  16. 4/4 t4014: add tests to cover --resend option and its exclusivityDragan Simic, Apr 17, 2024
  17. Eric SunshineApr 17, 2024
  18. Dragan SimicApr 17, 2024
  19. 3/4 format-patch: new --resend option for adding "RESEND" to patch subjectsDragan Simic, Apr 17, 2024
  20. Kristoffer HaugsbakkApr 17, 2024
  21. Dragan SimicApr 17, 2024
  22. Kristoffer HaugsbakkApr 17, 2024
  23. Dragan SimicApr 17, 2024
  24. Eric SunshineApr 17, 2024
  25. Dragan SimicApr 17, 2024
  26. Eric SunshineApr 17, 2024
  27. Dragan SimicApr 17, 2024
  28. Dragan SimicApr 18, 2024
  29. Phillip WoodApr 17, 2024
  30. Dragan SimicApr 17, 2024
  31. Kristoffer HaugsbakkApr 17, 2024
  32. Dragan SimicApr 17, 2024
  33. Kristoffer HaugsbakkApr 17, 2024
  34. Dragan SimicApr 17, 2024
  35. Junio C HamanoApr 17, 2024
  36. Dragan SimicApr 17, 2024
  37. Junio C HamanoApr 17, 2024
  38. Dragan SimicApr 17, 2024
  39. Dragan SimicApr 18, 2024
  40. Junio C HamanoApr 18, 2024
  41. Dragan SimicApr 19, 2024
  42. Eric SunshineApr 19, 2024
  43. Dragan SimicApr 19, 2024
  44. Eric SunshineApr 19, 2024
  45. Junio C HamanoApr 19, 2024
  46. Eric SunshineApr 19, 2024
  47. Junio C HamanoApr 19, 2024
  48. Eric SunshineApr 17, 2024
  49. Dragan SimicApr 17, 2024
  50. Eric SunshineApr 17, 2024
  51. Dragan SimicApr 17, 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.