* [PATCH] Checking for "diff.color." should come before "diff.color"
@ 2006-10-23 19:51 Andy Parkins
2006-10-23 20:29 ` Jeff King
[not found] ` <7vk62qydvu.fsf@assigned-by-dhcp.cox.net>
0 siblings, 2 replies; 5+ messages in thread
From: Andy Parkins @ 2006-10-23 19:51 UTC (permalink / raw)
To: git
In git_diff_ui_config() the strncmp() for "diff.color" would have matched for
"diff.color.", so "diff.color." configs would never be processed.
Fix is to move "diff.color." check before "diff.color"
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
diff.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index 3315378..d795be4 100644
--- a/diff.c
+++ b/diff.c
@@ -60,10 +60,6 @@ int git_diff_ui_config(const char *var,
diff_rename_limit_default = git_config_int(var, value);
return 0;
}
- if (!strcmp(var, "diff.color")) {
- diff_use_color_default = git_config_colorbool(var, value);
- return 0;
- }
if (!strcmp(var, "diff.renames")) {
if (!value)
diff_detect_rename_default = DIFF_DETECT_RENAME;
@@ -79,6 +75,10 @@ int git_diff_ui_config(const char *var,
color_parse(value, var, diff_colors[slot]);
return 0;
}
+ if (!strcmp(var, "diff.color")) {
+ diff_use_color_default = git_config_colorbool(var, value);
+ return 0;
+ }
return git_default_config(var, value);
}
--
1.4.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Checking for "diff.color." should come before "diff.color"
2006-10-23 19:51 [PATCH] Checking for "diff.color." should come before "diff.color" Andy Parkins
@ 2006-10-23 20:29 ` Jeff King
2006-10-23 20:52 ` Andy Parkins
[not found] ` <7vk62qydvu.fsf@assigned-by-dhcp.cox.net>
1 sibling, 1 reply; 5+ messages in thread
From: Jeff King @ 2006-10-23 20:29 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
On Mon, Oct 23, 2006 at 08:51:17PM +0100, Andy Parkins wrote:
> In git_diff_ui_config() the strncmp() for "diff.color" would have
> matched for "diff.color.", so "diff.color." configs would never be
> processed.
No, it's a strcmp for "diff.color", so it must match exactly. The code
is fine.
Are you experiencing some bug, or was this just from poking through the
code?
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Checking for "diff.color." should come before "diff.color"
2006-10-23 20:29 ` Jeff King
@ 2006-10-23 20:52 ` Andy Parkins
2006-10-23 21:57 ` Jeff King
0 siblings, 1 reply; 5+ messages in thread
From: Andy Parkins @ 2006-10-23 20:52 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
On Monday 2006, October 23 21:29, Jeff King wrote:
> No, it's a strcmp for "diff.color", so it must match exactly. The code
> is fine.
Oops. Yep. So far I'm zero for five on my git patches - not doing too well
am I? :-)
> Are you experiencing some bug, or was this just from poking through the
> code?
Nah; poking around only. I'm playing with git using the git repository. I
have a feeling it's making me noisy and annoying.
Andy
--
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Checking for "diff.color." should come before "diff.color"
[not found] ` <7vk62qydvu.fsf@assigned-by-dhcp.cox.net>
@ 2006-10-23 21:03 ` Andy Parkins
0 siblings, 0 replies; 5+ messages in thread
From: Andy Parkins @ 2006-10-23 21:03 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]
On Monday 2006, October 23 21:29, Junio C Hamano wrote:
> Andy Parkins <andyparkins@gmail.com> writes:
> > In git_diff_ui_config() the strncmp() for "diff.color" would have matched
> > for "diff.color.", so "diff.color." configs would never be processed.
>
> A test case that demonstrates the breakage without the patch
> would be nice. Could you come up with a two-patch series that
> is:
No need. Jeff King already caught the fact that my patch is unnecessary. I
withdraw it.
Sorry to keep bothering you all with these non-entity patches. I really am
only trying to help :-)
Andy
--
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Checking for "diff.color." should come before "diff.color"
2006-10-23 20:52 ` Andy Parkins
@ 2006-10-23 21:57 ` Jeff King
0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2006-10-23 21:57 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
On Mon, Oct 23, 2006 at 09:52:48PM +0100, Andy Parkins wrote:
> Oops. Yep. So far I'm zero for five on my git patches - not doing too well
> am I? :-)
Keep trying. Many eyes on the code is never a bad thing, and
fortunately there are many eyes on your patches, too. :)
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-10-23 21:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 19:51 [PATCH] Checking for "diff.color." should come before "diff.color" Andy Parkins
2006-10-23 20:29 ` Jeff King
2006-10-23 20:52 ` Andy Parkins
2006-10-23 21:57 ` Jeff King
[not found] ` <7vk62qydvu.fsf@assigned-by-dhcp.cox.net>
2006-10-23 21:03 ` Andy Parkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).