@matheusbsbs / matheus-bagliano / commits / 6b3020a241
Fork 0

add: introduce add.ignoreerrors synonym for add.ignore-errors

The "[add] ignore-errors" tweakable introduced by v1.5.6-rc0~30^2 (Add a config option to ignore errors for git-add, 2008-05-12) does not follow the usual convention for naming values in the git configuration file. What convention? Glad you asked. The section name indicates the affected subsystem. The subsection name, if any, indicates which of an unbound set of things to set the value for. The variable name describes the effect of tweaking this knob. The section and variable names can be broken into words using bumpyCaps in documentation as a hint to the reader. These word breaks are not significant at the level of code, since the section and variable names are not case sensitive. The name "add.ignore-errors" includes a dash, meaning a naive configuration file like [add] ignoreErrors does not have any effect. Avoid such confusion by renaming to the more consistent add.ignoreErrors, but keep the old version for backwards compatibility. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Dec 1, 2010 at 12:36 UTC 6b3020a241e2c0a1eaa6b74a10a796603bb90975
2 files changed +7 -2
Documentation/config.txt
+5 -1
@@ -534,9 +534,13 @@ core.sparseCheckout::
534 linkgit:git-read-tree[1] for more information.
535
536 add.ignore-errors::
537 +add.ignoreErrors::
538 Tells 'git add' to continue adding files when some files cannot be
539 added due to indexing errors. Equivalent to the '--ignore-errors'
539 - option of linkgit:git-add[1].
540 + option of linkgit:git-add[1]. Older versions of git accept only
541 + `add.ignore-errors`, which does not follow the usual naming
542 + convention for configuration variables. Newer versions of git
543 + honor `add.ignoreErrors` as well.
544
545 alias.*::
546 Command aliases for the linkgit:git[1] command wrapper - e.g.
builtin-add.c
+2 -1
@@ -328,7 +328,8 @@ static struct option builtin_add_options[] = {
328
329 static int add_config(const char *var, const char *value, void *cb)
330 {
331 - if (!strcasecmp(var, "add.ignore-errors")) {
331 + if (!strcasecmp(var, "add.ignoreerrors") ||
332 + !strcasecmp(var, "add.ignore-errors")) {
333 ignore_add_errors = git_config_bool(var, value);
334 return 0;
335 }