threads / patch / 45995

patchrebase -i: Add missing newline to end of message

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

## tl;dr

8 messages between May 18, 2017 and May 19, 2017. Diffs are folded; open one to read it.

replies: 7people: 3as markdown or json

Phillip Wood· May 18, 2017, 13:41 UTC · lore
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(-)
Show changes to sequencer.c +1 −1
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· May 18, 2017, 13:48 UTC · re: Phillip Wood · lore

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

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· May 18, 2017, 14:53 UTC · re: Ævar Arnfjörð Bjarmason · lore

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

On 18/05/17 14:48, Ævar Arnfjörð Bjarmason wrote:
Show 9 quoted lines
> 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· May 18, 2017, 21:21 UTC · re: Phillip Wood · lore

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

Hi Phillip,
On Thu, 18 May 2017, Phillip Wood wrote:
Show 5 quoted lines
> 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· May 19, 2017, 10:13 UTC · re: Johannes Schindelin · lore

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

On 18/05/17 22:21, Johannes Schindelin wrote:
Show 11 quoted lines
> 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· May 19, 2017, 11:24 UTC · re: Phillip Wood · lore

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

On Fri, May 19, 2017 at 12:13 PM, Phillip Wood <phillip.wood@talktalk.net> wrote:

Show 33 quoted lines
> 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· May 19, 2017, 14:35 UTC · re: Ævar Arnfjörð Bjarmason · lore

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

On 19/05/17 12:24, Ævar Arnfjörð Bjarmason wrote:
Show 57 quoted lines
> 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
phillip.wood@talktalk.net· May 19, 2017, 14:32 UTC · re: Phillip Wood · lore

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

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(-)
Show changes to sequencer.c +1 −1
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

← back to recent threads