{"thread":{"id":"6017","subject":"[PATCH] Checking for \"diff.color.\" should come before \"diff.color\"","startedAt":"2006-10-23T19:51:17Z","lastAt":"2006-10-23T21:57:26Z","messageCount":5,"participants":["Andy Parkins","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"29753","messageId":"200610232051.17396.andyparkins@gmail.com","threadId":"6017","inReplyTo":null,"subject":"[PATCH] Checking for \"diff.color.\" should come before \"diff.color\"","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-10-23T19:51:17Z","receivedAt":"2006-10-23T19:51:17Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"In git_diff_ui_config() the strncmp() for \"diff.color\" would have matched for\n\"diff.color.\", so \"diff.color.\" configs would never be processed.\n\nFix is to move \"diff.color.\" check before \"diff.color\"\nSigned-off-by: Andy Parkins <andyparkins@gmail.com>\n---\n diff.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 3315378..d795be4 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -60,10 +60,6 @@ int git_diff_ui_config(const char *var, \n \t\tdiff_rename_limit_default = git_config_int(var, value);\n \t\treturn 0;\n \t}\n-\tif (!strcmp(var, \"diff.color\")) {\n-\t\tdiff_use_color_default = git_config_colorbool(var, value);\n-\t\treturn 0;\n-\t}\n \tif (!strcmp(var, \"diff.renames\")) {\n \t\tif (!value)\n \t\t\tdiff_detect_rename_default = DIFF_DETECT_RENAME;\n@@ -79,6 +75,10 @@ int git_diff_ui_config(const char *var, \n \t\tcolor_parse(value, var, diff_colors[slot]);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"diff.color\")) {\n+\t\tdiff_use_color_default = git_config_colorbool(var, value);\n+\t\treturn 0;\n+\t}\n \treturn git_default_config(var, value);\n }\n \n-- \n1.4.2.3\n"},{"id":"29759","messageId":"20061023202952.GC31068@coredump.intra.peff.net","threadId":"6017","inReplyTo":"200610232051.17396.andyparkins@gmail.com","subject":"Re: [PATCH] Checking for \"diff.color.\" should come before \"diff.color\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-10-23T20:29:53Z","receivedAt":"2006-10-23T20:29:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 23, 2006 at 08:51:17PM +0100, Andy Parkins wrote:\n\n> In git_diff_ui_config() the strncmp() for \"diff.color\" would have\n> matched for \"diff.color.\", so \"diff.color.\" configs would never be\n> processed.\n\nNo, it's a strcmp for \"diff.color\", so it must match exactly. The code\nis fine.\n\nAre you experiencing some bug, or was this just from poking through the\ncode?\n\n-Peff\n"},{"id":"29762","messageId":"200610232152.48543.andyparkins@gmail.com","threadId":"6017","inReplyTo":"20061023202952.GC31068@coredump.intra.peff.net","subject":"Re: [PATCH] Checking for \"diff.color.\" should come before \"diff.color\"","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-10-23T20:52:48Z","receivedAt":"2006-10-23T20:52:48Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Monday 2006, October 23 21:29, Jeff King wrote:\n\n> No, it's a strcmp for \"diff.color\", so it must match exactly. The code\n> is fine.\n\nOops.  Yep.  So far I'm zero for five on my git patches - not doing too well \nam I?  :-)\n\n> Are you experiencing some bug, or was this just from poking through the\n> code?\n\nNah; poking around only.  I'm playing with git using the git repository.  I \nhave a feeling it's making me noisy and annoying.\n\n\nAndy\n\n-- \nDr Andrew Parkins, M Eng (Hons), AMIEE\nandyparkins@gmail.com\n"},{"id":"29764","messageId":"200610232203.40510.andyparkins@gmail.com","threadId":"6017","inReplyTo":"7vk62qydvu.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Checking for \"diff.color.\" should come before \"diff.color\"","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-10-23T21:03:40Z","receivedAt":"2006-10-23T21:03:40Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Monday 2006, October 23 21:29, Junio C Hamano wrote:\n> Andy Parkins <andyparkins@gmail.com> writes:\n> > In git_diff_ui_config() the strncmp() for \"diff.color\" would have matched\n> > for \"diff.color.\", so \"diff.color.\" configs would never be processed.\n>\n> A test case that demonstrates the breakage without the patch\n> would be nice. Could you come up with a two-patch series that\n> is:\n\nNo need.  Jeff King already caught the fact that my patch is unnecessary.  I \nwithdraw it.\n\nSorry to keep bothering you all with these non-entity patches.  I really am \nonly trying to help :-)\n\n\nAndy\n\n-- \nDr Andrew Parkins, M Eng (Hons), AMIEE\nandyparkins@gmail.com\n"},{"id":"29772","messageId":"20061023215726.GA8595@coredump.intra.peff.net","threadId":"6017","inReplyTo":"200610232152.48543.andyparkins@gmail.com","subject":"Re: [PATCH] Checking for \"diff.color.\" should come before \"diff.color\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-10-23T21:57:26Z","receivedAt":"2006-10-23T21:57:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 23, 2006 at 09:52:48PM +0100, Andy Parkins wrote:\n\n> Oops.  Yep.  So far I'm zero for five on my git patches - not doing too well \n> am I?  :-)\n\nKeep trying. Many eyes on the code is never a bad thing, and\nfortunately there are many eyes on your patches, too.  :)\n\n-Peff\n"}]}