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

Re: [PATCH 6/7] t/t3437: update the tests

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 7, 2021, 18:43 UTC
Message-ID
<CAPig+cTDT5Hct7dUTY93nO+P5-US=ZokuGhOQeELPpZwQGzf=w@mail.gmail.com>
In-Reply-To
<20210207181439.1178-7-charvi077@gmail.com>
On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:
Show 17 quoted lines
> Let's do the changes listed below to make tests more easier to follow :
>
> -Remove the dependency of 'expected-message' file from earlier tests to
> make it easier to run tests selectively with '--run' or 'GIT_SKIP_TESTS'.
>
> -Add author timestamp to check that the author date of fixed up commit
> is unchanged.
>
> -Simplify the test_commit_message() and add comments before the
> function.
>
> -Clarify the working of 'fixup -c' with "amend!" in the test-description.
>
> -Remove unnecessary curly braces and use the named commits in the
> tests so that they will still refer to the same commit if the setup
> gets changed in the future whereas 'branch~2' will change which commit
> it points to.

Typically, if you find yourself enumerating a list of distinct changes like this in a commit message, it's a good indication that it should be split into multiple patches, each taking care of one item from the list. A good reason for splitting it up like this is that it's difficult for reviewers to keep the entire list in mind while reviewing the patch, however, it's easy to keep in mind a single stated goal while reading the changes.

Having said that, I'm not sure it's worth a re-roll or the extra work of actually splitting it up since you've already been dragged deeper into this than planned, and these are relatively minor issues.

(Returning to this after reading the remainder of the patch, I did find it reasonably confusing trying to figure out which changes related to each other and to items from the list above. It would have been easier to reason about the changes had they been done in separate patches. Still, though, I'm not sure it's worth the time and effort to split them up -- but I wouldn't complain if you did.)

More below...
Show 14 quoted lines
> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
> ---
> diff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh
> @@ -8,8 +8,10 @@ test_description='git rebase interactive fixup options
>  This test checks the "fixup [-C|-c]" command of rebase interactive.
>  In addition to amending the contents of the commit, "fixup -C"
>  replaces the original commit message with the message of the fixup
> -commit. "fixup -c" also replaces the original message, but opens the
> -editor to allow the user to edit the message before committing.
> +commit and similar to "fixup" command that works with "fixup!", "fixup -C"
> +works with "amend!" upon --autosquash. "fixup -c" also replaces the original
> +message, but opens the editor to allow the user to edit the message before
> +committing.
>  '

I had trouble digesting this run-on sentence due, I think, to the mixing of thoughts. It might be easier to understand if you first talk only about the options to `fixup` (-c/-C), and then, as a separate sentence, talk about how `amend!` is transformed into `fixup -C` (like `fixup!` is transformed into `fixup`). However, as this is just minor descriptive text in a test file, not user-facing documentation, I'm not sure it matters enough to warrant a re-roll.

Show 5 quoted lines
> @@ -18,36 +20,34 @@ editor to allow the user to edit the message before committing.
> +# test_commit_message <rev> -m <msg>
> +# test_commit_message <rev> <path>
> +# Verify that the commit message of <rev> matches
> +# <msg> or the content of <path>.
Good.
Show 8 quoted lines
>  test_commit_message () {
> +       git show --no-patch --pretty=format:%B "$1" >actual &&
> +    case "$2" in
> +    -m) echo "$3" >expect &&
> +           test_cmp expect actual ;;
> +    *) test_cmp "$2" actual ;;
> +    esac
>  }

The funky indentation here is due to a mix of tabs and spaces. It should use tabs exclusively.

Previous: Charvi MendirattaNext: Charvi Mendiratta
Message 14 of 58 in “[Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase”
  1. 0/7 [Outreachy] Improve the 'fixup [-C | -c]' in interactive rebaseCharvi Mendiratta, Feb 7, 2021
  2. 1/7 sequencer: fixup the datatype of the 'flag' argumentCharvi Mendiratta, Feb 7, 2021
  3. 2/7 sequencer: rename a few functionsCharvi Mendiratta, Feb 7, 2021
  4. 3/7 rebase -i: clarify and fix 'fixup -c' rebase-todo helpCharvi Mendiratta, Feb 7, 2021
  5. Eric SunshineFeb 7, 2021
  6. Charvi MendirattaFeb 8, 2021
  7. 7/7 doc/rebase -i: fix typo in the documentation of 'fixup' commandCharvi Mendiratta, Feb 7, 2021
  8. 5/7 t3437: fix indendation of the here-docCharvi Mendiratta, Feb 7, 2021
  9. Eric SunshineFeb 7, 2021
  10. Charvi MendirattaFeb 8, 2021
  11. Phillip WoodFeb 8, 2021
  12. 4/7 t/lib-rebase: change the implementation of commands with optionsCharvi Mendiratta, Feb 7, 2021
  13. 6/7 t/t3437: update the testsCharvi Mendiratta, Feb 7, 2021
  14. Eric SunshineFeb 7, 2021
  15. Charvi MendirattaFeb 8, 2021
  16. Eric SunshineFeb 7, 2021
  17. Charvi MendirattaFeb 8, 2021
  18. 00/11 [Outreachy] Improve the 'fixup [-C | -c]' in interactive rebaseCharvi Mendiratta, Feb 8, 2021
  19. Junio C HamanoFeb 8, 2021
  20. Charvi MendirattaFeb 9, 2021
  21. 01/11 sequencer: fixup the datatype of the 'flag' argumentCharvi Mendiratta, Feb 8, 2021
  22. 02/11 sequencer: rename a few functionsCharvi Mendiratta, Feb 8, 2021
  23. 03/11 rebase -i: clarify and fix 'fixup -c' rebase-todo helpCharvi Mendiratta, Feb 8, 2021
  24. Junio C HamanoFeb 8, 2021
  25. Charvi MendirattaFeb 9, 2021
  26. Eric SunshineFeb 9, 2021
  27. Junio C HamanoFeb 9, 2021
  28. Eric SunshineFeb 9, 2021
  29. Charvi MendirattaFeb 10, 2021
  30. 04/11 t/lib-rebase: change the implementation of commands with optionsCharvi Mendiratta, Feb 8, 2021
  31. Junio C HamanoFeb 8, 2021
  32. Christian CouderFeb 8, 2021
  33. Charvi MendirattaFeb 9, 2021
  34. 05/11 t/t3437: fix indentation of the here-docCharvi Mendiratta, Feb 8, 2021
  35. 06/11 t/t3437: remove the dependency of 'expected-message' file from testsCharvi Mendiratta, Feb 8, 2021
  36. 07/11 t/t3437: check author date of the fixed up commitCharvi Mendiratta, Feb 8, 2021
  37. 10/11 t/t3437: fixup the test 'multiple fixup -c opens editor once'Charvi Mendiratta, Feb 8, 2021
  38. 08/11 t/t3437: simplify and document the test helpersCharvi Mendiratta, Feb 8, 2021
  39. 09/11 t/t3437: cleanup the 'setup' test and use named commits in the testsCharvi Mendiratta, Feb 8, 2021
  40. Junio C HamanoFeb 8, 2021
  41. Charvi MendirattaFeb 9, 2021
  42. 11/11 doc/rebase -i: fix typo in the documentation of 'fixup' commandCharvi Mendiratta, Feb 8, 2021
  43. 00/11 [Outreachy] Improve the 'fixup [-C | -c]' in interactive rebaseCharvi Mendiratta, Feb 10, 2021
  44. Junio C HamanoFeb 11, 2021
  45. Charvi MendirattaFeb 11, 2021
  46. Junio C HamanoFeb 11, 2021
  47. Charvi MendirattaFeb 12, 2021
  48. 01/11 sequencer: fixup the datatype of the 'flag' argumentCharvi Mendiratta, Feb 10, 2021
  49. 03/11 rebase -i: clarify and fix 'fixup -c' rebase-todo helpCharvi Mendiratta, Feb 10, 2021
  50. 05/11 t/t3437: fixup here-docs in the 'setup' testCharvi Mendiratta, Feb 10, 2021
  51. 04/11 t/lib-rebase: update the documentation of FAKE_LINESCharvi Mendiratta, Feb 10, 2021
  52. 02/11 sequencer: rename a few functionsCharvi Mendiratta, Feb 10, 2021
  53. 06/11 t/t3437: remove the dependency of 'expected-message' file from testsCharvi Mendiratta, Feb 10, 2021
  54. 07/11 t/t3437: check the author date of fixed up commitCharvi Mendiratta, Feb 10, 2021
  55. 08/11 t/t3437: simplify and document the test helpersCharvi Mendiratta, Feb 10, 2021
  56. 09/11 t/t3437: use named commits in the testsCharvi Mendiratta, Feb 10, 2021
  57. 10/11 t/t3437: fixup the test 'multiple fixup -c opens editor once'Charvi Mendiratta, Feb 10, 2021
  58. 11/11 doc/rebase -i: fix typo in the documentation of 'fixup' commandCharvi Mendiratta, Feb 10, 2021

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.