diff mbox series

[v2,03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help

Message ID 20210208192528.21399-4-charvi077@gmail.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Charvi Mendiratta Feb. 8, 2021, 7:25 p.m. UTC
When `-c` says "edit the commit message" it's not clear what will be
edited. The original's commit message or the replacement's message or a
combination of the two. Word it such that it states more precisely what
exactly will be edited. While at it, also drop the jarring period and
capitalization, neither of which is otherwise present in the message.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
---
 rebase-interactive.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Junio C Hamano Feb. 8, 2021, 9:24 p.m. UTC | #1
Charvi Mendiratta <charvi077@gmail.com> writes:

> When `-c` says "edit the commit message" it's not clear what will be
> edited. The original's commit message or the replacement's message or a
> combination of the two. Word it such that it states more precisely what
> exactly will be edited. While at it, also drop the jarring period and
> capitalization, neither of which is otherwise present in the message.

>
> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
> ---
>  rebase-interactive.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/rebase-interactive.c b/rebase-interactive.c
> index c3bd02adee..e85994beb6 100644
> --- a/rebase-interactive.c
> +++ b/rebase-interactive.c
> @@ -45,8 +45,8 @@ void append_todo_help(int command_count,
>  "e, edit <commit> = use commit, but stop for amending\n"
>  "s, squash <commit> = use commit, but meld into previous commit\n"
>  "f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
> -"                   commit's log message. Use -C to replace with this\n"
> -"                   commit message or -c to edit the commit message\n"
> +"                   commit's log message; use -C to replace with this\n"
> +"                   commit message or -c to edit this commit message\n"

The goal is good, but I am not sure if this "the commit" -> "this commit"
is an effective enough way to fix the issue.  Here is my attempt but
I do not think it is not 10x better to be worth replacing yours X-<.

    use only the log message of the "fixup" commit, discarding the
    message from the previous commit.  While "-C" uses the message
    as-is, "-c" lets the user further edit it.

>  "x, exec <command> = run command (the rest of the line) using shell\n"
>  "b, break = stop here (continue rebase later with 'git rebase --continue')\n"
>  "d, drop <commit> = remove commit\n"
> @@ -55,7 +55,7 @@ void append_todo_help(int command_count,
>  "m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
>  ".       create a merge commit using the original merge commit's\n"
>  ".       message (or the oneline, if no original merge commit was\n"
> -".       specified). Use -c <commit> to reword the commit message.\n"
> +".       specified); use -c <commit> to reword the commit message\n"

This hunk fixes the formatting by dropping the full-stop.  Unlike
the description of "fixup -C/-c", I find it very easy to understand.

Thanks.
Charvi Mendiratta Feb. 9, 2021, 7:13 a.m. UTC | #2
Hi Junio,

> >  "f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
> > -"                   commit's log message. Use -C to replace with this\n"
> > -"                   commit message or -c to edit the commit message\n"
> > +"                   commit's log message; use -C to replace with this\n"
> > +"                   commit message or -c to edit this commit message\n"
>
> The goal is good, but I am not sure if this "the commit" -> "this commit"
> is an effective enough way to fix the issue.  Here is my attempt but
> I do not think it is not 10x better to be worth replacing yours X-<.
>
>     use only the log message of the "fixup" commit, discarding the
>     message from the previous commit.  While "-C" uses the message
>     as-is, "-c" lets the user further edit it.
>

Okay, but in this patch we are also removing period and capitalization from
rebase to-do help of commands. So, maybe we can replace it like :

f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
 "                  commit's log message; use -C to use only the\n"
 "                  log message of the "fixup" commit, discarding the\n"
 "                  message from the previous commit; while -C uses \n"
 "                  the message as-is, -c allows to further edit it\n"

If it is okay ?

Thanks and Regards,
Charvi
Eric Sunshine Feb. 9, 2021, 8:33 a.m. UTC | #3
On Tue, Feb 9, 2021 at 2:13 AM Charvi Mendiratta <charvi077@gmail.com> wrote:
> > The goal is good, but I am not sure if this "the commit" -> "this commit"
> > is an effective enough way to fix the issue.  Here is my attempt but
> > I do not think it is not 10x better to be worth replacing yours X-<.
> >
> >     use only the log message of the "fixup" commit, discarding the
> >     message from the previous commit.  While "-C" uses the message
> >     as-is, "-c" lets the user further edit it.
>
> Okay, but in this patch we are also removing period and capitalization from
> rebase to-do help of commands. So, maybe we can replace it like :
>
> f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
>  "                  commit's log message; use -C to use only the\n"
>  "                  log message of the "fixup" commit, discarding the\n"
>  "                  message from the previous commit; while -C uses \n"
>  "                  the message as-is, -c allows to further edit it\n"

Here's another more concise attempt:

    like "squash" but keep only the previous commit's log message,
    unless -C is used, in which case keep only this commit's message;
    -c is same as -C but opens editor
Junio C Hamano Feb. 9, 2021, 7:08 p.m. UTC | #4
Eric Sunshine <sunshine@sunshineco.com> writes:

> Here's another more concise attempt:
>
>     like "squash" but keep only the previous commit's log message,
>     unless -C is used, in which case keep only this commit's message;
>     -c is same as -C but opens editor

Nice.
Eric Sunshine Feb. 9, 2021, 7:13 p.m. UTC | #5
On Tue, Feb 9, 2021 at 2:08 PM Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > Here's another more concise attempt:
> >
> >     like "squash" but keep only the previous commit's log message,
> >     unless -C is used, in which case keep only this commit's message;
> >     -c is same as -C but opens editor
>
> Nice.

For conciseness, I intentionally omitted "the", however, upon
reflection, it probably would be a good idea to insert "the" between
"opens" and "editor".
Charvi Mendiratta Feb. 10, 2021, 5:43 a.m. UTC | #6
On Wed, 10 Feb 2021 at 00:43, Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Tue, Feb 9, 2021 at 2:08 PM Junio C Hamano <gitster@pobox.com> wrote:
> > Eric Sunshine <sunshine@sunshineco.com> writes:
> > > Here's another more concise attempt:
> > >
> > >     like "squash" but keep only the previous commit's log message,
> > >     unless -C is used, in which case keep only this commit's message;
> > >     -c is same as -C but opens editor
> >
> > Nice.
>
> For conciseness, I intentionally omitted "the", however, upon
> reflection, it probably would be a good idea to insert "the" between
> "opens" and "editor".

Okay, I agree this is also very easy to understand and will update it.

Thanks !
diff mbox series

Patch

diff --git a/rebase-interactive.c b/rebase-interactive.c
index c3bd02adee..e85994beb6 100644
--- a/rebase-interactive.c
+++ b/rebase-interactive.c
@@ -45,8 +45,8 @@  void append_todo_help(int command_count,
 "e, edit <commit> = use commit, but stop for amending\n"
 "s, squash <commit> = use commit, but meld into previous commit\n"
 "f, fixup [-C | -c] <commit> = like \"squash\", but discard this\n"
-"                   commit's log message. Use -C to replace with this\n"
-"                   commit message or -c to edit the commit message\n"
+"                   commit's log message; use -C to replace with this\n"
+"                   commit message or -c to edit this commit message\n"
 "x, exec <command> = run command (the rest of the line) using shell\n"
 "b, break = stop here (continue rebase later with 'git rebase --continue')\n"
 "d, drop <commit> = remove commit\n"
@@ -55,7 +55,7 @@  void append_todo_help(int command_count,
 "m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
 ".       create a merge commit using the original merge commit's\n"
 ".       message (or the oneline, if no original merge commit was\n"
-".       specified). Use -c <commit> to reword the commit message.\n"
+".       specified); use -c <commit> to reword the commit message\n"
 "\n"
 "These lines can be re-ordered; they are executed from top to bottom.\n");
 	unsigned edit_todo = !(shortrevisions && shortonto);