# [PATCH] rebase -i: Fix white space in comments

7 messages from 2018-06-26 to 2018-06-27. Participants: dana, Johannes Schindelin, Wink Saville.
Thread: https://gitlist.dev/t/48783

## dana, 2018-06-26 18:02

Subject: [PATCH] rebase -i: Fix white space in comments
Message-ID: <614F0C12-7173-48BD-9212-71AD6FBBDAA7@dana.is>
URL: https://gitlist.dev/e/614F0C12-7173-48BD-9212-71AD6FBBDAA7%40dana.is

```
Fix a trivial white-space issue introduced by commit d48f97aa8
("rebase: reindent function git_rebase__interactive", 2018-03-23). This
affected the instructional comments displayed in the editor during an
interactive rebase.

Signed-off-by: dana <dana@dana.is>
---

Sorry if i've done any of this wrong; i've never used this work-flow
before. In any case, if it's not immediately obvious, this is the issue
i mean to fix:

BEFORE (2.17.1):

# 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

AFTER (2.18.0):

# 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

The 2.18.0 version is particularly irritating because many editors
highlight the trailing tab in the penultimate line as a white-space
error.

Aside: It's not a new thing, but i've always felt like that last line
should end in a full stop. Maybe i'll send a patch for that too.

Cheers,
dana

 git-rebase--interactive.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 299ded213..a31af6d4c 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
-- 
2.18.0


```

## Johannes Schindelin, 2018-06-26 21:30

Subject: Re: [PATCH] rebase -i: Fix white space in comments
Message-ID: <nycvar.QRO.7.76.6.1806262329390.21419@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1806262329390.21419%40tvgsbejvaqbjf.bet
In-Reply-To: <614F0C12-7173-48BD-9212-71AD6FBBDAA7@dana.is>

```
Let's Cc: Wink, who authored the commit mentioned as culprit in the commit
message.


On Tue, 26 Jun 2018, dana wrote:

> Fix a trivial white-space issue introduced by commit d48f97aa8
> ("rebase: reindent function git_rebase__interactive", 2018-03-23). This
> affected the instructional comments displayed in the editor during an
> interactive rebase.
> 
> Signed-off-by: dana <dana@dana.is>
> ---
> 
> Sorry if i've done any of this wrong; i've never used this work-flow
> before. In any case, if it's not immediately obvious, this is the issue
> i mean to fix:
> 
> BEFORE (2.17.1):
> 
> # 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
> 
> AFTER (2.18.0):
> 
> # 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
> 
> The 2.18.0 version is particularly irritating because many editors
> highlight the trailing tab in the penultimate line as a white-space
> error.
> 
> Aside: It's not a new thing, but i've always felt like that last line
> should end in a full stop. Maybe i'll send a patch for that too.
> 
> Cheers,
> dana
> 
>  git-rebase--interactive.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 299ded213..a31af6d4c 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
> -- 
> 2.18.0
> 
> 

```

## Johannes Schindelin, 2018-06-26 21:35

Subject: Re: [PATCH] rebase -i: Fix white space in comments
Message-ID: <nycvar.QRO.7.76.6.1806262331340.21419@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1806262331340.21419%40tvgsbejvaqbjf.bet
In-Reply-To: <nycvar.QRO.7.76.6.1806262329390.21419@tvgsbejvaqbjf.bet>

```
Hi,

and now for the review...

On Tue, 26 Jun 2018, Johannes Schindelin wrote:

> On Tue, 26 Jun 2018, dana wrote:
> 
> > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> > index 299ded213..a31af6d4c 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

This does the job, and I am fine with this way of doing things, and there
seems to be a lot of precedent doing it this way e.g. in git-bisect.sh.

If my ACK is welcome, you hereby have it.

Ciao,
Johannes

```

## Johannes Schindelin, 2018-06-26 21:44

Subject: Re: [PATCH] rebase -i: Fix white space in comments
Message-ID: <nycvar.QRO.7.76.6.1806262343410.21419@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1806262343410.21419%40tvgsbejvaqbjf.bet
In-Reply-To: <nycvar.QRO.7.76.6.1806262331340.21419@tvgsbejvaqbjf.bet>

```
Hi, me again,

On Tue, 26 Jun 2018, Johannes Schindelin wrote:

> On Tue, 26 Jun 2018, Johannes Schindelin wrote:
> 
> > On Tue, 26 Jun 2018, dana wrote:
> > 
> > > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> > > index 299ded213..a31af6d4c 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
> 
> This does the job, and I am fine with this way of doing things, and there
> seems to be a lot of precedent doing it this way e.g. in git-bisect.sh.

There is of course one other way to fix this, and that is by rewriting
this in C.

Which Alban has done here ;-)

http://public-inbox.org/git/20180626161643.31152-3-alban.gruin@gmail.com

Ciao,
Johannes

```

## dana, 2018-06-26 21:54

Subject: Re: [PATCH] rebase -i: Fix white space in comments
Message-ID: <D5941A31-B9B3-4EB1-9D55-D5E86A541D2C@dana.is>
URL: https://gitlist.dev/e/D5941A31-B9B3-4EB1-9D55-D5E86A541D2C%40dana.is
In-Reply-To: <nycvar.QRO.7.76.6.1806262343410.21419@tvgsbejvaqbjf.bet>

```
On 26 Jun 2018, at 16:44, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>There is of course one other way to fix this, and that is by rewriting
>this in C.
>
>Which Alban has done here ;-)
>
>http://public-inbox.org/git/20180626161643.31152-3-alban.gruin@gmail.com

Oh, i'm sorry, i didn't see that. That change does appear to solve the
same problem, so i'm happy to defer to it.

Thanks for looking!

dana


```

## Johannes Schindelin, 2018-06-27 10:52

Subject: Re: [PATCH] rebase -i: Fix white space in comments
Message-ID: <nycvar.QRO.7.76.6.1806271251130.21419@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1806271251130.21419%40tvgsbejvaqbjf.bet
In-Reply-To: <D5941A31-B9B3-4EB1-9D55-D5E86A541D2C@dana.is>

```
Hi Dana,

On Tue, 26 Jun 2018, dana wrote:

> On 26 Jun 2018, at 16:44, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >There is of course one other way to fix this, and that is by rewriting
> >this in C.
> >
> >Which Alban has done here ;-)
> >
> >http://public-inbox.org/git/20180626161643.31152-3-alban.gruin@gmail.com
> 
> Oh, i'm sorry, i didn't see that.

No need to be sorry, nobody expects you to read the "firehose" that is the
Git mailing list in its entirety.

> That change does appear to solve the same problem, so i'm happy to defer
> to it.

Thank you for confirming that it also fixes your issue, that is very
helpful!

Ciao,
Johannes

```

## Wink Saville, 2018-06-27 18:51

Subject: Re: [PATCH] rebase -i: Fix white space in comments
Message-ID: <CAKk8ispLOsfe+t9yMaLdWd9tzN+zBfrXBmt3j-PjF1dYYJbfLg@mail.gmail.com>
URL: https://gitlist.dev/e/CAKk8ispLOsfe%2Bt9yMaLdWd9tzN%2BzBfrXBmt3j-PjF1dYYJbfLg%40mail.gmail.com
In-Reply-To: <nycvar.QRO.7.76.6.1806271251130.21419@tvgsbejvaqbjf.bet>

```
 Sorry for the whitespace bug, it looks like everything is under
control one way or the other.

```
