{"thread":{"id":"50975","subject":"[PATCH] status: add an empty line when there is no hint","startedAt":"2019-04-23T09:20:02Z","lastAt":"2019-04-30T04:46:58Z","messageCount":3,"participants":["John Lin","Phil Hord","林自均"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"374311","messageId":"20190423091837.50290-1-johnlinp@gmail.com","threadId":"50975","inReplyTo":null,"subject":"[PATCH] status: add an empty line when there is no hint","fromName":"John Lin","fromEmail":"johnlinp@gmail.com","sentAt":"2019-04-23T09:18:37Z","receivedAt":"2019-04-23T09:20:02Z","isPatch":true,"sender":{"key":"johnlinp@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1290376?v=4"},"body":"When typing \"git status\", there is an empty line between\nthe \"Changes not staged for commit:\" block and the list\nof changed files. However, when typing \"git commit\" with\nno files added, there are no empty lines between them.\n\nThis patch adds empty lines in the above case and some\nsimilar cases.\n\nSigned-off-by: John Lin <johnlinp@gmail.com>\n---\n wt-status.c | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 445a36204a..0766e3ee12 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -175,7 +175,7 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)\n \t}\n \n \tif (!s->hints)\n-\t\treturn;\n+\t\tgoto conclude;\n \tif (s->whence != FROM_COMMIT)\n \t\t;\n \telse if (!s->is_initial)\n@@ -193,6 +193,7 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)\n \t} else {\n \t\tstatus_printf_ln(s, c, _(\"  (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\"));\n \t}\n+conclude:\n \tstatus_printf_ln(s, c, \"%s\", \"\");\n }\n \n@@ -202,13 +203,14 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)\n \n \tstatus_printf_ln(s, c, _(\"Changes to be committed:\"));\n \tif (!s->hints)\n-\t\treturn;\n+\t\tgoto conclude;\n \tif (s->whence != FROM_COMMIT)\n \t\t; /* NEEDSWORK: use \"git reset --unresolve\"??? */\n \telse if (!s->is_initial)\n \t\tstatus_printf_ln(s, c, _(\"  (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n \telse\n \t\tstatus_printf_ln(s, c, _(\"  (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n+conclude:\n \tstatus_printf_ln(s, c, \"%s\", \"\");\n }\n \n@@ -220,7 +222,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n \n \tstatus_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n \tif (!s->hints)\n-\t\treturn;\n+\t\tgoto conclude;\n \tif (!has_deleted)\n \t\tstatus_printf_ln(s, c, _(\"  (use \\\"git add <file>...\\\" to update what will be committed)\"));\n \telse\n@@ -228,6 +230,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n \tstatus_printf_ln(s, c, _(\"  (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\"));\n \tif (has_dirty_submodules)\n \t\tstatus_printf_ln(s, c, _(\"  (commit or discard the untracked or modified content in submodules)\"));\n+conclude:\n \tstatus_printf_ln(s, c, \"%s\", \"\");\n }\n \n@@ -238,8 +241,9 @@ static void wt_longstatus_print_other_header(struct wt_status *s,\n \tconst char *c = color(WT_STATUS_HEADER, s);\n \tstatus_printf_ln(s, c, \"%s:\", what);\n \tif (!s->hints)\n-\t\treturn;\n+\t\tgoto conclude;\n \tstatus_printf_ln(s, c, _(\"  (use \\\"git %s <file>...\\\" to include in what will be committed)\"), how);\n+conclude:\n \tstatus_printf_ln(s, c, \"%s\", \"\");\n }\n \n-- \n2.21.0\n\n"},{"id":"374690","messageId":"CABURp0rSTT=8biNhBvsGP4fdEHBT4B5beVKsm=Mdp7Ei8Dw72w@mail.gmail.com","threadId":"50975","inReplyTo":"20190423091837.50290-1-johnlinp@gmail.com","subject":"Re: [PATCH] status: add an empty line when there is no hint","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2019-04-30T03:12:05Z","receivedAt":"2019-04-30T03:12:22Z","isPatch":true,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"You should probably add some test that demonstrates what your change\nintends to do.  For that matter, though, your test already breaks at\nleast two tests in t7508-status.sh:\n\nnot ok 14 - status (advice.statusHints false)\nnot ok 23 - status -uno (advice.statusHints false)\n\nPhil\n\nOn Tue, Apr 23, 2019 at 2:21 AM John Lin <johnlinp@gmail.com> wrote:\n>\n> When typing \"git status\", there is an empty line between\n> the \"Changes not staged for commit:\" block and the list\n> of changed files. However, when typing \"git commit\" with\n> no files added, there are no empty lines between them.\n>\n> This patch adds empty lines in the above case and some\n> similar cases.\n>\n> Signed-off-by: John Lin <johnlinp@gmail.com>\n> ---\n>  wt-status.c | 12 ++++++++----\n>  1 file changed, 8 insertions(+), 4 deletions(-)\n>\n> diff --git a/wt-status.c b/wt-status.c\n> index 445a36204a..0766e3ee12 100644\n> --- a/wt-status.c\n> +++ b/wt-status.c\n> @@ -175,7 +175,7 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)\n>         }\n>\n>         if (!s->hints)\n> -               return;\n> +               goto conclude;\n>         if (s->whence != FROM_COMMIT)\n>                 ;\n>         else if (!s->is_initial)\n> @@ -193,6 +193,7 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)\n>         } else {\n>                 status_printf_ln(s, c, _(\"  (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\"));\n>         }\n> +conclude:\n>         status_printf_ln(s, c, \"%s\", \"\");\n>  }\n>\n> @@ -202,13 +203,14 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)\n>\n>         status_printf_ln(s, c, _(\"Changes to be committed:\"));\n>         if (!s->hints)\n> -               return;\n> +               goto conclude;\n>         if (s->whence != FROM_COMMIT)\n>                 ; /* NEEDSWORK: use \"git reset --unresolve\"??? */\n>         else if (!s->is_initial)\n>                 status_printf_ln(s, c, _(\"  (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n>         else\n>                 status_printf_ln(s, c, _(\"  (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n> +conclude:\n>         status_printf_ln(s, c, \"%s\", \"\");\n>  }\n>\n> @@ -220,7 +222,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n>\n>         status_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n>         if (!s->hints)\n> -               return;\n> +               goto conclude;\n>         if (!has_deleted)\n>                 status_printf_ln(s, c, _(\"  (use \\\"git add <file>...\\\" to update what will be committed)\"));\n>         else\n> @@ -228,6 +230,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n>         status_printf_ln(s, c, _(\"  (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\"));\n>         if (has_dirty_submodules)\n>                 status_printf_ln(s, c, _(\"  (commit or discard the untracked or modified content in submodules)\"));\n> +conclude:\n>         status_printf_ln(s, c, \"%s\", \"\");\n>  }\n>\n> @@ -238,8 +241,9 @@ static void wt_longstatus_print_other_header(struct wt_status *s,\n>         const char *c = color(WT_STATUS_HEADER, s);\n>         status_printf_ln(s, c, \"%s:\", what);\n>         if (!s->hints)\n> -               return;\n> +               goto conclude;\n>         status_printf_ln(s, c, _(\"  (use \\\"git %s <file>...\\\" to include in what will be committed)\"), how);\n> +conclude:\n>         status_printf_ln(s, c, \"%s\", \"\");\n>  }\n>\n> --\n> 2.21.0\n>\n"},{"id":"374691","messageId":"CAKO26MswBM5sjuVSnxssOc4jd+hqXiko=+6ROatOm2H7jndujA@mail.gmail.com","threadId":"50975","inReplyTo":"CABURp0rSTT=8biNhBvsGP4fdEHBT4B5beVKsm=Mdp7Ei8Dw72w@mail.gmail.com","subject":"Re: [PATCH] status: add an empty line when there is no hint","fromName":"林自均","fromEmail":"johnlinp@gmail.com","sentAt":"2019-04-30T04:46:44Z","receivedAt":"2019-04-30T04:46:58Z","isPatch":true,"sender":{"key":"johnlinp@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1290376?v=4"},"body":"Hi Phil,\n\nThank you for the review! I will fix the test cases and submit a new\nversion of my patch.\n\nBest,\nJohn Lin\n\nPhil Hord <phil.hord@gmail.com> 於 2019年4月30日 週二 上午11:12寫道：\n>\n> You should probably add some test that demonstrates what your change\n> intends to do.  For that matter, though, your test already breaks at\n> least two tests in t7508-status.sh:\n>\n> not ok 14 - status (advice.statusHints false)\n> not ok 23 - status -uno (advice.statusHints false)\n>\n> Phil\n>\n> On Tue, Apr 23, 2019 at 2:21 AM John Lin <johnlinp@gmail.com> wrote:\n> >\n> > When typing \"git status\", there is an empty line between\n> > the \"Changes not staged for commit:\" block and the list\n> > of changed files. However, when typing \"git commit\" with\n> > no files added, there are no empty lines between them.\n> >\n> > This patch adds empty lines in the above case and some\n> > similar cases.\n> >\n> > Signed-off-by: John Lin <johnlinp@gmail.com>\n> > ---\n> >  wt-status.c | 12 ++++++++----\n> >  1 file changed, 8 insertions(+), 4 deletions(-)\n> >\n> > diff --git a/wt-status.c b/wt-status.c\n> > index 445a36204a..0766e3ee12 100644\n> > --- a/wt-status.c\n> > +++ b/wt-status.c\n> > @@ -175,7 +175,7 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)\n> >         }\n> >\n> >         if (!s->hints)\n> > -               return;\n> > +               goto conclude;\n> >         if (s->whence != FROM_COMMIT)\n> >                 ;\n> >         else if (!s->is_initial)\n> > @@ -193,6 +193,7 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)\n> >         } else {\n> >                 status_printf_ln(s, c, _(\"  (use \\\"git add/rm <file>...\\\" as appropriate to mark resolution)\"));\n> >         }\n> > +conclude:\n> >         status_printf_ln(s, c, \"%s\", \"\");\n> >  }\n> >\n> > @@ -202,13 +203,14 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)\n> >\n> >         status_printf_ln(s, c, _(\"Changes to be committed:\"));\n> >         if (!s->hints)\n> > -               return;\n> > +               goto conclude;\n> >         if (s->whence != FROM_COMMIT)\n> >                 ; /* NEEDSWORK: use \"git reset --unresolve\"??? */\n> >         else if (!s->is_initial)\n> >                 status_printf_ln(s, c, _(\"  (use \\\"git reset %s <file>...\\\" to unstage)\"), s->reference);\n> >         else\n> >                 status_printf_ln(s, c, _(\"  (use \\\"git rm --cached <file>...\\\" to unstage)\"));\n> > +conclude:\n> >         status_printf_ln(s, c, \"%s\", \"\");\n> >  }\n> >\n> > @@ -220,7 +222,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n> >\n> >         status_printf_ln(s, c, _(\"Changes not staged for commit:\"));\n> >         if (!s->hints)\n> > -               return;\n> > +               goto conclude;\n> >         if (!has_deleted)\n> >                 status_printf_ln(s, c, _(\"  (use \\\"git add <file>...\\\" to update what will be committed)\"));\n> >         else\n> > @@ -228,6 +230,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,\n> >         status_printf_ln(s, c, _(\"  (use \\\"git checkout -- <file>...\\\" to discard changes in working directory)\"));\n> >         if (has_dirty_submodules)\n> >                 status_printf_ln(s, c, _(\"  (commit or discard the untracked or modified content in submodules)\"));\n> > +conclude:\n> >         status_printf_ln(s, c, \"%s\", \"\");\n> >  }\n> >\n> > @@ -238,8 +241,9 @@ static void wt_longstatus_print_other_header(struct wt_status *s,\n> >         const char *c = color(WT_STATUS_HEADER, s);\n> >         status_printf_ln(s, c, \"%s:\", what);\n> >         if (!s->hints)\n> > -               return;\n> > +               goto conclude;\n> >         status_printf_ln(s, c, _(\"  (use \\\"git %s <file>...\\\" to include in what will be committed)\"), how);\n> > +conclude:\n> >         status_printf_ln(s, c, \"%s\", \"\");\n> >  }\n> >\n> > --\n> > 2.21.0\n> >\n"}]}