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

Re: [PATCH 3/3] t/lib-rebase: improve documentation of set_fake_editor()

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Aug 9, 2023, 13:04 UTC
Message-ID
<8ce40f48-f36f-9e81-1a3f-9d8b170c4a0f@gmail.com>
In-Reply-To
<20230807170935.2336663-4-oswald.buddenhagen@gmx.de>
Hi Oswald

Thanks for splitting these patches up. We generally prefer commits message to be prose explaining the reason for the change rather than bullet points.

On 07/08/2023 18:09, Oswald Buddenhagen wrote:
> - Make it reflect better what actually happens.
> This makes it easier to
>    fully exploit the possibilities and to modify the code.
I don't really see how this follows from the first sentence.
> - Improve the structure, putting more general info further up.
Good idea
> - Document `fakesha` and `break`.
Great
Show 26 quoted lines
> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> ---
> Cc: Phillip Wood <phillip.wood123@gmail.com>
> ---
>   t/lib-rebase.sh | 21 ++++++++++++---------
>   1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh
> index 9ed87ca7ab..184b25b427 100644
> --- a/t/lib-rebase.sh
> +++ b/t/lib-rebase.sh
> @@ -8,18 +8,21 @@
>   # - check that non-commit messages have a certain line count with $EXPECT_COUNT
>   # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
>   # - rewrite a rebase -i script as directed by $FAKE_LINES.
> -#   $FAKE_LINES consists of a sequence of words separated by spaces.
> -#   The following word combinations are possible:
> +#   $FAKE_LINES consists of a sequence of words separated by spaces;
> +#   spaces inside the words are encoded as underscores.
> +#   The following words are possible:
>   #
> -#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
> -#       specified line.
> +#   "<cmd>" -- override the command for the next line specification. Can be
> +#       "pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword",
> +#       "drop", "merge[_-{c|C}_<SHA1>]", 

There is an inconsistency here in how we document fixup and merge. The former explicitly lists all possibilities and the latter uses a more compact notation. Note that we use docopt style descriptions for options so "{c|C}" would be written as "(c|C)". Also "merge -c/C" takes a commitish (which we could write as <rev>" rather than a hex object ID.

 > or "bad" for an invalid command.
This is a useful addition
Show 12 quoted lines
> -#   "<cmd> <lineno>" -- add a line with the specified command
> -#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
> -#       and the SHA1 taken from the specified line.
> +#   "<lineno>" -- add a command, using the specified line as a template.
> +#       If the command has not been overridden, the line will be copied
> +#       verbatim, usually resulting in a "pick" line.
>   #
> -#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
> -#       "exec_cmd_with_args" add an "exec cmd with args" line.
> +#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
> +#
> +#   "exec_[...]", "break" -- add the specified command.
Something like
	exec[_<command ...>]
would be more accurate I think

I think with a couple of tweaks this would be worthwhile improvement to the documentation. Having comprehensive coverage of all the commands is very welcome.

Thanks
Phillip
Previous: Oswald BuddenhagenNext: Oswald Buddenhagen
Message 10 of 22 in “t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()”
  1. t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()Oswald Buddenhagen, Mar 23, 2023
  2. Oswald BuddenhagenApr 26, 2023
  3. Junio C HamanoApr 26, 2023
  4. Felipe ContrerasMay 2, 2023
  5. Phillip WoodMay 17, 2023
  6. 0/3 t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()Oswald Buddenhagen, Aug 7, 2023
  7. 1/3 t/lib-rebase: set_fake_editor(): fix recognition of reset's short commandOswald Buddenhagen, Aug 7, 2023
  8. Junio C HamanoAug 7, 2023
  9. 3/3 t/lib-rebase: improve documentation of set_fake_editor()Oswald Buddenhagen, Aug 7, 2023
  10. Phillip WoodAug 9, 2023
  11. 0/1 t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()Oswald Buddenhagen, Aug 9, 2023
  12. 1/1 t/lib-rebase: improve documentation of set_fake_editor()Oswald Buddenhagen, Aug 9, 2023
  13. Junio C HamanoAug 9, 2023
  14. Phillip WoodAug 10, 2023
  15. Junio C HamanoAug 10, 2023
  16. Junio C HamanoAug 9, 2023
  17. Oswald BuddenhagenAug 10, 2023
  18. Junio C HamanoAug 10, 2023
  19. Junio C HamanoAug 10, 2023
  20. 2/3 t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistentlyOswald Buddenhagen, Aug 7, 2023
  21. Junio C HamanoAug 7, 2023
  22. Phillip WoodAug 9, 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.