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

Subsystems: the rest

STALE3443d

8 messages, 3 authors, 2017-05-19 · open the first message on its own page

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

From: Phillip Wood <hidden>
Date: 2017-05-18 13:42:26

From: Phillip Wood <redacted>

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

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2017-05-18 13:48:34

On Thu, May 18, 2017 at 3:41 PM, Phillip Wood [off-list ref] wrote:
From: Phillip Wood <redacted>

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.

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

From: Phillip Wood <hidden>
Date: 2017-05-18 14:53:53

On 18/05/17 14:48, Ævar Arnfjörð Bjarmason wrote:
On Thu, May 18, 2017 at 3:41 PM, Phillip Wood [off-list ref] wrote:
quoted
From: Phillip Wood <redacted>

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

From: Johannes Schindelin <hidden>
Date: 2017-05-18 21:21:35

Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:
From: Phillip Wood <redacted>

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

From: Phillip Wood <hidden>
Date: 2017-05-19 10:14:02

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

On Thu, 18 May 2017, Phillip Wood wrote:
quoted
From: Phillip Wood <redacted>

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2017-05-19 11:25:13

On Fri, May 19, 2017 at 12:13 PM, Phillip Wood
[off-list ref] wrote:
On 18/05/17 22:21, Johannes Schindelin wrote:
quoted
Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:
quoted
From: Phillip Wood <redacted>

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

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

From: <hidden>
Date: 2017-05-19 14:33:28

From: Phillip Wood <redacted>

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

Signed-off-by: Phillip Wood <redacted>
Acked-by: Johannes Schindelin <redacted>
---
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

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

From: Phillip Wood <hidden>
Date: 2017-05-19 14:35:42

On 19/05/17 12:24, Ævar Arnfjörð Bjarmason wrote:
On Fri, May 19, 2017 at 12:13 PM, Phillip Wood
[off-list ref] wrote:
quoted
On 18/05/17 22:21, Johannes Schindelin wrote:
quoted
Hi Phillip,

On Thu, 18 May 2017, Phillip Wood wrote:
quoted
From: Phillip Wood <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help