# [PATCH] rebase -i: Add missing newline to end of message

8 messages from 2017-05-18 to 2017-05-19. Participants: Phillip Wood, Ævar Arnfjörð Bjarmason, Johannes Schindelin, phillip.wood@talktalk.net.
Thread: https://gitlist.dev/t/45995

## Phillip Wood, 2017-05-18 13:41

Subject: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <20170518134154.12771-1-phillip.wood@talktalk.net>
URL: https://gitlist.dev/e/20170518134154.12771-1-phillip.wood%40talktalk.net

```
From: Phillip Wood <phillip.wood@dunelm.org.uk>

The message that's printed when auto-stashed changes are successfully
restored was missing '\n' at the end.
---
 sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index 311728a14..4dcf9c8be 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1920,7 +1920,7 @@ static int apply_autostash(struct replay_opts *opts)
 	argv_array_push(&child.args, "apply");
 	argv_array_push(&child.args, stash_sha1.buf);
 	if (!run_command(&child))
-		printf(_("Applied autostash."));
+		printf(_("Applied autostash.\n"));
 	else {
 		struct child_process store = CHILD_PROCESS_INIT;
 
-- 
2.13.0


```

## Ævar Arnfjörð Bjarmason, 2017-05-18 13:48

Subject: Re: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <CACBZZX4hbe+bDbxQKy92ruD8=4V7pqnOi9WyBqhunG-F8=wXRw@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX4hbe%2BbDbxQKy92ruD8%3D4V7pqnOi9WyBqhunG-F8%3DwXRw%40mail.gmail.com
In-Reply-To: <20170518134154.12771-1-phillip.wood@talktalk.net>

```
On Thu, May 18, 2017 at 3:41 PM, Phillip Wood <phillip.wood@talktalk.net> wrote:
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> The message that's printed when auto-stashed changes are successfully
> restored was missing '\n' at the end.

Both this and your reflog message really seem like the sort of tricky
edge cases we should have tests for.

```

## Phillip Wood, 2017-05-18 14:53

Subject: Re: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <3e4ad130-0932-f465-281d-20acfe3125a2@talktalk.net>
URL: https://gitlist.dev/e/3e4ad130-0932-f465-281d-20acfe3125a2%40talktalk.net
In-Reply-To: <CACBZZX4hbe+bDbxQKy92ruD8=4V7pqnOi9WyBqhunG-F8=wXRw@mail.gmail.com>

```
On 18/05/17 14:48, Ævar Arnfjörð Bjarmason wrote:
> On Thu, May 18, 2017 at 3:41 PM, Phillip Wood <phillip.wood@talktalk.net> wrote:
>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>>
>> The message that's printed when auto-stashed changes are successfully
>> restored was missing '\n' at the end.
> 
> Both this and your reflog message really seem like the sort of tricky
> edge cases we should have tests for.
> 
Yes I agree, I'll try and put something together when I have time

Best Wishes

Phillip

```

## Johannes Schindelin, 2017-05-18 21:21

Subject: Re: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <alpine.DEB.2.21.1.1705182321030.3610@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.21.1.1705182321030.3610%40virtualbox
In-Reply-To: <20170518134154.12771-1-phillip.wood@talktalk.net>

```
Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:

> From: Phillip Wood <phillip.wood@dunelm.org.uk>
> 
> The message that's printed when auto-stashed changes are successfully
> restored was missing '\n' at the end.
> ---

Please add your Signed-off-by:, and my Acked-by:

Thanks,
Johannes

```

## Phillip Wood, 2017-05-19 10:13

Subject: Re: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <406d017b-b138-72db-d5ad-14ccf5d1f3d4@talktalk.net>
URL: https://gitlist.dev/e/406d017b-b138-72db-d5ad-14ccf5d1f3d4%40talktalk.net
In-Reply-To: <alpine.DEB.2.21.1.1705182321030.3610@virtualbox>

```
On 18/05/17 22:21, Johannes Schindelin wrote:
> Hi Phillip,
> 
> On Thu, 18 May 2017, Phillip Wood wrote:
> 
>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>>
>> The message that's printed when auto-stashed changes are successfully
>> restored was missing '\n' at the end.
>> ---
> 
> Please add your Signed-off-by:, and my Acked-by:

Will do (I forgot to add --signoff to git commit). Do I need to resend
the other patches with your Acked-by: or will that happen when Junio
applies them?

I was thinking about this last night and wonder if it would be better to do

-		printf(_("Applied autostash."));
+		printf("%s\n", _("Applied autostash."));

rather than

-		printf(_("Applied autostash."));
+		printf(_("Applied autostash.\n"));

as it would avoid changing the translated string and also mean that the
newline couldn't be accidentally removed any typos in the translation.

Best Wishes

Phillip

```

## Ævar Arnfjörð Bjarmason, 2017-05-19 11:24

Subject: Re: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <CACBZZX5yyD-EA0obHKGGueUgf4xO9o=sBAsBOrrPipx3vNPmsA@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX5yyD-EA0obHKGGueUgf4xO9o%3DsBAsBOrrPipx3vNPmsA%40mail.gmail.com
In-Reply-To: <406d017b-b138-72db-d5ad-14ccf5d1f3d4@talktalk.net>

```
On Fri, May 19, 2017 at 12:13 PM, Phillip Wood
<phillip.wood@talktalk.net> wrote:
> On 18/05/17 22:21, Johannes Schindelin wrote:
>> Hi Phillip,
>>
>> On Thu, 18 May 2017, Phillip Wood wrote:
>>
>>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>>>
>>> The message that's printed when auto-stashed changes are successfully
>>> restored was missing '\n' at the end.
>>> ---
>>
>> Please add your Signed-off-by:, and my Acked-by:
>
> Will do (I forgot to add --signoff to git commit). Do I need to resend
> the other patches with your Acked-by: or will that happen when Junio
> applies them?
>
> I was thinking about this last night and wonder if it would be better to do
>
> -               printf(_("Applied autostash."));
> +               printf("%s\n", _("Applied autostash."));
>
> rather than
>
> -               printf(_("Applied autostash."));
> +               printf(_("Applied autostash.\n"));
>
> as it would avoid changing the translated string and also mean that the
> newline couldn't be accidentally removed any typos in the translation.
>
> Best Wishes
>
> Phillip

Just having the \n in the message is fine. Stuff like this is already
checked for as part of the build process by msgfmt, e.g.:

    $ git diff -U0
    diff --git a/po/de.po b/po/de.po
    index 679f8f4720..b9a7d417ac 100644
    --- a/po/de.po
    +++ b/po/de.po
    @@ -23 +23 @@ msgid "hint: %.*s\n"
    -msgstr "Hinweis: %.*s\n"
    +msgstr "Hinweis: %.*s"

Errors with:

    po/de.po:23: 'msgid' and 'msgstr' entries do not both end with '\n'

And if you change the format specifier:

    po/de.po:23: number of format specifications in 'msgid' and
'msgstr' does not match

```

## phillip.wood@talktalk.net, 2017-05-19 14:32

Subject: [PATCH v2] rebase -i: Add missing newline to end of message
Message-ID: <20170519143248.22358-1-phillip.wood@talktalk.net>
URL: https://gitlist.dev/e/20170519143248.22358-1-phillip.wood%40talktalk.net
In-Reply-To: <20170518134154.12771-1-phillip.wood@talktalk.net>

```
From: Phillip Wood <phillip.wood@dunelm.org.uk>

The message that's printed when auto-stashed changes are successfully
restored was missing '\n' at the end.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
I've added signed-off-by and acked-by lines to the commit message,
otherwise this is unchanged

 sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index 311728a145dfc66e230334221a2610468239932d..4dcf9c8be044247c6c18a4ec2a4675d9df9953eb 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1920,7 +1920,7 @@ static int apply_autostash(struct replay_opts *opts)
 	argv_array_push(&child.args, "apply");
 	argv_array_push(&child.args, stash_sha1.buf);
 	if (!run_command(&child))
-		printf(_("Applied autostash."));
+		printf(_("Applied autostash.\n"));
 	else {
 		struct child_process store = CHILD_PROCESS_INIT;
 
-- 
2.13.0


```

## Phillip Wood, 2017-05-19 14:35

Subject: Re: [PATCH] rebase -i: Add missing newline to end of message
Message-ID: <a0912474-0d79-df10-80a8-5866398926a2@talktalk.net>
URL: https://gitlist.dev/e/a0912474-0d79-df10-80a8-5866398926a2%40talktalk.net
In-Reply-To: <CACBZZX5yyD-EA0obHKGGueUgf4xO9o=sBAsBOrrPipx3vNPmsA@mail.gmail.com>

```
On 19/05/17 12:24, Ævar Arnfjörð Bjarmason wrote:
> On Fri, May 19, 2017 at 12:13 PM, Phillip Wood
> <phillip.wood@talktalk.net> wrote:
>> On 18/05/17 22:21, Johannes Schindelin wrote:
>>> Hi Phillip,
>>>
>>> On Thu, 18 May 2017, Phillip Wood wrote:
>>>
>>>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>>>>
>>>> The message that's printed when auto-stashed changes are successfully
>>>> restored was missing '\n' at the end.
>>>> ---
>>>
>>> Please add your Signed-off-by:, and my Acked-by:
>>
>> Will do (I forgot to add --signoff to git commit). Do I need to resend
>> the other patches with your Acked-by: or will that happen when Junio
>> applies them?
>>
>> I was thinking about this last night and wonder if it would be better to do
>>
>> -               printf(_("Applied autostash."));
>> +               printf("%s\n", _("Applied autostash."));
>>
>> rather than
>>
>> -               printf(_("Applied autostash."));
>> +               printf(_("Applied autostash.\n"));
>>
>> as it would avoid changing the translated string and also mean that the
>> newline couldn't be accidentally removed any typos in the translation.
>>
>> Best Wishes
>>
>> Phillip
> 
> Just having the \n in the message is fine. Stuff like this is already
> checked for as part of the build process by msgfmt, e.g.:
> 
>      $ git diff -U0
>      diff --git a/po/de.po b/po/de.po
>      index 679f8f4720..b9a7d417ac 100644
>      --- a/po/de.po
>      +++ b/po/de.po
>      @@ -23 +23 @@ msgid "hint: %.*s\n"
>      -msgstr "Hinweis: %.*s\n"
>      +msgstr "Hinweis: %.*s"
> 
> Errors with:
> 
>      po/de.po:23: 'msgid' and 'msgstr' entries do not both end with '\n'
> 
> And if you change the format specifier:
> 
>      po/de.po:23: number of format specifications in 'msgid' and
> 'msgstr' does not match
> 
Hi Ævar

Thanks for clarifying that, I've left the patch unchanged

Thanks again

Phillip

```
