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

2017-05-19 Thread Phillip Wood

On 19/05/17 12:24, Ævar Arnfjörð Bjarmason wrote:

On Fri, May 19, 2017 at 12:13 PM, Phillip Wood
 wrote:

On 18/05/17 22:21, Johannes Schindelin wrote:

Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:


From: Phillip Wood 

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


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

2017-05-19 Thread Ævar Arnfjörð Bjarmason
On Fri, May 19, 2017 at 12:13 PM, Phillip Wood
 wrote:
> On 18/05/17 22:21, Johannes Schindelin wrote:
>> Hi Phillip,
>>
>> On Thu, 18 May 2017, Phillip Wood wrote:
>>
>>> From: Phillip Wood 
>>>
>>> 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


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

2017-05-19 Thread Phillip Wood
On 18/05/17 22:21, Johannes Schindelin wrote:
> Hi Phillip,
> 
> On Thu, 18 May 2017, Phillip Wood wrote:
> 
>> From: Phillip Wood 
>>
>> 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


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

2017-05-18 Thread Johannes Schindelin
Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:

> From: Phillip Wood 
> 
> 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


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

2017-05-18 Thread Phillip Wood

On 18/05/17 14:48, Ævar Arnfjörð Bjarmason wrote:

On Thu, May 18, 2017 at 3:41 PM, Phillip Wood  wrote:

From: Phillip Wood 

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



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

2017-05-18 Thread Ævar Arnfjörð Bjarmason
On Thu, May 18, 2017 at 3:41 PM, Phillip Wood  wrote:
> From: Phillip Wood 
>
> 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.


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

2017-05-18 Thread Phillip Wood
From: Phillip Wood 

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(, "apply");
argv_array_push(, stash_sha1.buf);
if (!run_command())
-   printf(_("Applied autostash."));
+   printf(_("Applied autostash.\n"));
else {
struct child_process store = CHILD_PROCESS_INIT;
 
-- 
2.13.0