{"thread":{"id":"17055","subject":"[PATCH, resend] git-commit: colored status when color.ui is set","startedAt":"2009-01-08T18:53:01Z","lastAt":"2009-01-09T16:24:59Z","messageCount":4,"participants":["Markus Heidelberg","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"99733","messageId":"200901081953.01418.markus.heidelberg@web.de","threadId":"17055","inReplyTo":null,"subject":"[PATCH, resend] git-commit: colored status when color.ui is set","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-01-08T18:53:01Z","receivedAt":"2009-01-08T18:53:01Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"When using \"git commit\" and there was nothing to commit (the editor\nwasn't launched), the status output wasn't colored, even though color.ui\nwas set. Only when setting color.status it worked.\n\nSigned-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n---\n builtin-commit.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex e88b78f..2d90f74 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -945,6 +945,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \n \tgit_config(git_commit_config, NULL);\n \n+\tif (wt_status_use_color == -1)\n+\t\twt_status_use_color = git_use_color_default;\n+\n \targc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);\n \n \tindex_file = prepare_index(argc, argv, prefix);\n-- \n1.6.1.35.g0c23\n"},{"id":"99770","messageId":"7viqoo26rq.fsf@gitster.siamese.dyndns.org","threadId":"17055","inReplyTo":"200901081953.01418.markus.heidelberg@web.de","subject":"Re: [PATCH, resend] git-commit: colored status when color.ui is set","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-09T09:00:41Z","receivedAt":"2009-01-09T09:00:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Markus Heidelberg <markus.heidelberg@web.de> writes:\n\n> When using \"git commit\" and there was nothing to commit (the editor\n> wasn't launched), the status output wasn't colored, even though color.ui\n> was set. Only when setting color.status it worked.\n>\n> Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n> ---\n>  builtin-commit.c |    3 +++\n>  1 files changed, 3 insertions(+), 0 deletions(-)\n>\n> diff --git a/builtin-commit.c b/builtin-commit.c\n> index e88b78f..2d90f74 100644\n> --- a/builtin-commit.c\n> +++ b/builtin-commit.c\n> @@ -945,6 +945,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n>  \n>  \tgit_config(git_commit_config, NULL);\n>  \n> +\tif (wt_status_use_color == -1)\n> +\t\twt_status_use_color = git_use_color_default;\n> +\n>  \targc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);\n>  \n>  \tindex_file = prepare_index(argc, argv, prefix);\n\nMy first reaction was:\n\n\tWhen the editor does get launched, what would the new code do with\n\tyour patch?  Would we see bunch of escape codes in the editor now?\n\nBut we do disable color explicitly when we generate contents to feed the\neditor in that case since bc5d248 (builtin-commit: do not color status\noutput shown in the message template, 2007-11-18), so that fear is\nunfounded.\n\nThanks for a reminder, will queue.\n"},{"id":"99783","messageId":"alpine.DEB.1.00.0901091155210.30769@pacific.mpi-cbg.de","threadId":"17055","inReplyTo":"7viqoo26rq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH, resend] git-commit: colored status when color.ui is set","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-09T10:56:08Z","receivedAt":"2009-01-09T10:56:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 9 Jan 2009, Junio C Hamano wrote:\n\n> Markus Heidelberg <markus.heidelberg@web.de> writes:\n> \n> > When using \"git commit\" and there was nothing to commit (the editor\n> > wasn't launched), the status output wasn't colored, even though color.ui\n> > was set. Only when setting color.status it worked.\n> >\n> > Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n> > ---\n> >  builtin-commit.c |    3 +++\n> >  1 files changed, 3 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/builtin-commit.c b/builtin-commit.c\n> > index e88b78f..2d90f74 100644\n> > --- a/builtin-commit.c\n> > +++ b/builtin-commit.c\n> > @@ -945,6 +945,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n> >  \n> >  \tgit_config(git_commit_config, NULL);\n> >  \n> > +\tif (wt_status_use_color == -1)\n> > +\t\twt_status_use_color = git_use_color_default;\n> > +\n> >  \targc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);\n> >  \n> >  \tindex_file = prepare_index(argc, argv, prefix);\n> \n> My first reaction was:\n> \n> \tWhen the editor does get launched, what would the new code do with\n> \tyour patch?  Would we see bunch of escape codes in the editor now?\n> \n> But we do disable color explicitly when we generate contents to feed the\n> editor in that case since bc5d248 (builtin-commit: do not color status\n> output shown in the message template, 2007-11-18), so that fear is\n> unfounded.\n\nI had the same reaction, so I would like to see this reasoning in the \ncommit message.\n\nCiao,\nDscho\n"},{"id":"99798","messageId":"200901091724.59983.markus.heidelberg@web.de","threadId":"17055","inReplyTo":"alpine.DEB.1.00.0901091155210.30769@pacific.mpi-cbg.de","subject":"Re: [PATCH, resend] git-commit: colored status when color.ui is set","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-01-09T16:24:59Z","receivedAt":"2009-01-09T16:24:59Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Johannes Schindelin, 09.01.2009:\n> Hi,\n> \n> On Fri, 9 Jan 2009, Junio C Hamano wrote:\n> \n> > Markus Heidelberg <markus.heidelberg@web.de> writes:\n> > > When using \"git commit\" and there was nothing to commit (the editor\n> > > wasn't launched), the status output wasn't colored, even though color.ui\n> > > was set. Only when setting color.status it worked.\n> > \n> > My first reaction was:\n> > \n> > \tWhen the editor does get launched, what would the new code do with\n> > \tyour patch?  Would we see bunch of escape codes in the editor now?\n\nOf course I tested this case :)\n\n> > But we do disable color explicitly when we generate contents to feed the\n> > editor in that case since bc5d248 (builtin-commit: do not color status\n> > output shown in the message template, 2007-11-18), so that fear is\n> > unfounded.\n> \n> I had the same reaction, so I would like to see this reasoning in the \n> commit message.\n\nwt_status_use_color could have already been set during git_config()\nwithout this patch, just not with color.ui, but color.status, so this is\nnot really a new case. But I can understand the reaction and don't have\nocjections against this explanation in the commit message.\n\nMarkus\n"}]}