threads / patch / 48828

patchgit-rebase--{interactive,preserve-merges}: fix formatting of todo help message

Subject: [PATCH] git-rebase--{interactive,preserve-merges}: fix formatting of todo help message

## tl;dr

5 messages between Jul 4, 2018 and Jul 6, 2018. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Tobias Klauser· Jul 4, 2018, 12:17 UTC · lore

Part of the todo help message in git-rebase--interactive.sh and git-rebase--preserve-merges.sh is unnecessarily indented, making the message look weird:

  # These lines can be re-ordered; they are executed from top to bottom.
  #
  # If you remove a line here THAT COMMIT WILL BE LOST.
  #
  #       However, if you remove everything, the rebase will be aborted.
  #
  #
  # Note that empty commits are commented out
Remove the extra lines and trailing indent to make it look as follows:
  # These lines can be re-ordered; they are executed from top to bottom.
  #
  # If you remove a line here THAT COMMIT WILL BE LOST.
  #
  # However, if you remove everything, the rebase will be aborted.
  #
  # Note that empty commits are commented out
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 git-rebase--interactive.sh     | 4 ++--
 git-rebase--preserve-merges.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Show changes to 2 files +4 −4

git-rebase--interactive.sh, git-rebase--preserve-merges.sh

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 299ded21375e..a31af6d4c419 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -222,9 +222,9 @@ $comment_char $(eval_ngettext \
 EOF
 	append_todo_help
 	gettext "
-	However, if you remove everything, the rebase will be aborted.
+However, if you remove everything, the rebase will be aborted.
 
-	" | git stripspace --comment-lines >>"$todo"
+" | git stripspace --comment-lines >>"$todo"
 
 	if test -z "$keep_empty"
 	then
diff --git a/git-rebase--preserve-merges.sh b/git-rebase--preserve-merges.sh
index c51c7828e7b3..c214c5e4d6ce 100644
--- a/git-rebase--preserve-merges.sh
+++ b/git-rebase--preserve-merges.sh
@@ -891,9 +891,9 @@ $comment_char $(eval_ngettext \
 EOF
 	append_todo_help
 	gettext "
-	However, if you remove everything, the rebase will be aborted.
+However, if you remove everything, the rebase will be aborted.
 
-	" | git stripspace --comment-lines >>"$todo"
+" | git stripspace --comment-lines >>"$todo"
 
 	if test -z "$keep_empty"
 	then
-- 
2.18.0.130.g98da2f6b3e4a
Johannes Schindelin· Jul 4, 2018, 13:09 UTC · re: Tobias Klauser · lore

Re: [PATCH] git-rebase--{interactive,preserve-merges}: fix formatting of todo help message

Hi Tobias,
On Wed, 4 Jul 2018, Tobias Klauser wrote:
Show 24 quoted lines
> Part of the todo help message in git-rebase--interactive.sh and
> git-rebase--preserve-merges.sh is unnecessarily indented, making the
> message look weird:
> 
>   # These lines can be re-ordered; they are executed from top to bottom.
>   #
>   # If you remove a line here THAT COMMIT WILL BE LOST.
>   #
>   #       However, if you remove everything, the rebase will be aborted.
>   #
>   #
>   # Note that empty commits are commented out
> 
> Remove the extra lines and trailing indent to make it look as follows:
> 
>   # These lines can be re-ordered; they are executed from top to bottom.
>   #
>   # If you remove a line here THAT COMMIT WILL BE LOST.
>   #
>   # However, if you remove everything, the rebase will be aborted.
>   #
>   # Note that empty commits are commented out
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Thank you for this contribution!

Funnily enough, the same fix had been provided here: https://public-inbox.org/git/614F0C12-7173-48BD-9212-71AD6FBBDAA7@dana.is/ although only for `git-rebase--interactive.sh`.

In that thread, we agreed that it overlaps too much with a GSoC project, and that that project already addresses the same problem by way of rewriting that part in C (and therefore we decided it would be better to go with those patches).

However, your patch also covers this:
>  git-rebase--preserve-merges.sh | 4 ++--
I completely missed that in the earlier patch.

Junio, this gets an ACK from me, could you apply the `git-rebase--preserve-merges.sh` part selectively, please?

Ciao, Johannes

Tobias Klauser· Jul 4, 2018, 14:16 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git-rebase--{interactive,preserve-merges}: fix formatting of todo help message

Hi Johannes
Thanks for your detailed answer.
On 2018-07-04 at 15:09:34 +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 37 quoted lines
> On Wed, 4 Jul 2018, Tobias Klauser wrote:
> 
> > Part of the todo help message in git-rebase--interactive.sh and
> > git-rebase--preserve-merges.sh is unnecessarily indented, making the
> > message look weird:
> > 
> >   # These lines can be re-ordered; they are executed from top to bottom.
> >   #
> >   # If you remove a line here THAT COMMIT WILL BE LOST.
> >   #
> >   #       However, if you remove everything, the rebase will be aborted.
> >   #
> >   #
> >   # Note that empty commits are commented out
> > 
> > Remove the extra lines and trailing indent to make it look as follows:
> > 
> >   # These lines can be re-ordered; they are executed from top to bottom.
> >   #
> >   # If you remove a line here THAT COMMIT WILL BE LOST.
> >   #
> >   # However, if you remove everything, the rebase will be aborted.
> >   #
> >   # Note that empty commits are commented out
> > 
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> 
> Thank you for this contribution!
> 
> Funnily enough, the same fix had been provided here:
> https://public-inbox.org/git/614F0C12-7173-48BD-9212-71AD6FBBDAA7@dana.is/
> although only for `git-rebase--interactive.sh`.
> 
> In that thread, we agreed that it overlaps too much with a GSoC project,
> and that that project already addresses the same problem by way of
> rewriting that part in C (and therefore we decided it would be better to
> go with those patches).

Unfortunately I don't follow git development that closely anymore, so I wasn't aware of the previous patch and the discussion. Sorry about the duplication/conflict.

And I'm glad to see that this part will be rewritten in C :-)
Show 8 quoted lines
> However, your patch also covers this:
> 
> >  git-rebase--preserve-merges.sh | 4 ++--
> 
> I completely missed that in the earlier patch.
> 
> Junio, this gets an ACK from me, could you apply the
> `git-rebase--preserve-merges.sh` part selectively, please?

Let me know if I should provide an updated patch just for git-rebase--preserve-merges.sh

Thanks Tobias

Johannes Schindelin· Jul 4, 2018, 19:32 UTC · re: Tobias Klauser · lore

Re: [PATCH] git-rebase--{interactive,preserve-merges}: fix formatting of todo help message

Hi Tobias,
On Wed, 4 Jul 2018, Tobias Klauser wrote:
Show 7 quoted lines
> On 2018-07-04 at 15:09:34 +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > Junio, this gets an ACK from me, could you apply the
> > `git-rebase--preserve-merges.sh` part selectively, please?
> 
> Let me know if I should provide an updated patch just for
> git-rebase--preserve-merges.sh

I think we'll have to wait for tomorrow to get an answer to this; today is a holiday in the States.

Ciao, Johannes

Junio C Hamano· Jul 6, 2018, 18:30 UTC · re: Tobias Klauser · lore

Re: [PATCH] git-rebase--{interactive,preserve-merges}: fix formatting of todo help message

Tobias Klauser <tklauser@distanz.ch> writes:
Show 10 quoted lines
> And I'm glad to see that this part will be rewritten in C :-)
>
>> However, your patch also covers this:
>> 
>> >  git-rebase--preserve-merges.sh | 4 ++--
>> 
>> I completely missed that in the earlier patch.
>> 
>> Junio, this gets an ACK from me, could you apply the
>> `git-rebase--preserve-merges.sh` part selectively, please?
Here is what I assembled from various pieces in the list archive.
-- >8 --
Subject: [PATCH] git-rebase--preserve-merges: fix formatting of todo help message

Part of the todo help message in git-rebase--preserve-merges.sh is unnecessarily indented, making the message look weird. Remove the extra lines and trailing indent.

This was a minor regression introduced by d48f97aa ("rebase: reindent function git_rebase__interactive", 2018-03-23) in the 2.18 timeframe. The same issue exists in "rebase -i", but it is being addressed separately as part of the rewrite of the subcommand into C.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-rebase--preserve-merges.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to git-rebase--preserve-merges.sh +2 −2
diff --git a/git-rebase--preserve-merges.sh b/git-rebase--preserve-merges.sh
index c51c7828e7..c214c5e4d6 100644
--- a/git-rebase--preserve-merges.sh
+++ b/git-rebase--preserve-merges.sh
@@ -891,9 +891,9 @@ $comment_char $(eval_ngettext \
 EOF
 	append_todo_help
 	gettext "
-	However, if you remove everything, the rebase will be aborted.
+However, if you remove everything, the rebase will be aborted.
 
-	" | git stripspace --comment-lines >>"$todo"
+" | git stripspace --comment-lines >>"$todo"
 
 	if test -z "$keep_empty"
 	then

← back to recent threads