From: Junio C Hamano Date: Mon, 14 Jan 2013 22:08:04 GMT Subject: Re: [PATCH v2] Make git selectively and conditionally ignore certain stat fields Message-ID: <7vip6z8lkr.fsf@alter.siamese.dyndns.org> In-Reply-To: <1358197878-36736-1-git-send-email-robin.rosenberg@dewire.com> Robin Rosenberg writes: > @@ -566,6 +566,31 @@ static int git_default_core_config(const char *var, const char *value) > trust_ctime = git_config_bool(var, value); > return 0; > } > + if (!strcmp(var, "core.ignorezerostat")) { > + char *copy, *tok; > + git_config_string(©, "core.ignorezerostat", value); > + check_nonzero_stat = CHECK_NONZERO_STAT_MASK; > + tok = strtok(value, ","); > + while (tok) { > + if (strcasecmp(tok, "uid") == 0) > + check_nonzero_stat &= ~CHECK_NONZERO_STAT_UID; > + else if (strcasecmp(tok, "gid") == 0) > + check_nonzero_stat &= ~CHECK_NONZERO_STAT_GID; > + else if (strcasecmp(tok, "ctime") == 0) { > + check_nonzero_stat &= ~CHECK_NONZERO_STAT_CTIME; > + trust_ctime = 0; > + } else if (strcasecmp(tok, "ino") == 0) > + check_nonzero_stat &= ~CHECK_NONZERO_STAT_INO; > + else if (strcasecmp(tok, "dev") == 0) > + check_nonzero_stat &= ~CHECK_NONZERO_STAT_DEV; > + else > + die_bad_config(var); > + tok = strtok(NULL, ","); > + } > + if (check_nonzero_stat >= CHECK_NONZERO_STAT_MASK) > + die_bad_config(var); > + free(copy); > + } Also I am getting these: config.c: In function 'git_default_core_config': config.c:571: error: passing argument 1 of 'git_config_string' from incompatible pointer type config.c:540: note: expected 'const char **' but argument is of type 'char **' config.c:573: error: passing argument 1 of 'strtok' discards qualifiers from pointer target type