Skip to content

Commit 6b3020a

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 593ce2b commit 6b3020a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Documentation/config.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,13 @@ core.sparseCheckout::
534534
linkgit:git-read-tree[1] for more information.
535535

536536
add.ignore-errors::
537+
add.ignoreErrors::
537538
Tells 'git add' to continue adding files when some files cannot be
538539
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.
540544

541545
alias.*::
542546
Command aliases for the linkgit:git[1] command wrapper - e.g.

builtin-add.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ static struct option builtin_add_options[] = {
328328

329329
static int add_config(const char *var, const char *value, void *cb)
330330
{
331-
if (!strcasecmp(var, "add.ignore-errors")) {
331+
if (!strcasecmp(var, "add.ignoreerrors") ||
332+
!strcasecmp(var, "add.ignore-errors")) {
332333
ignore_add_errors = git_config_bool(var, value);
333334
return 0;
334335
}

0 commit comments

Comments
 (0)