git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] add: introduce add.ignoreerrors synonym for add.ignore-errors

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 1, 2010, 18:36 UTC
Message-ID
<20101201183615.GA27024@burratino>
In-Reply-To
<20101201175517.GA7774@sigill.intra.peff.net>

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.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Jeff King wrote:
> On Wed, Dec 01, 2010 at 10:34:06AM -0600, Jonathan Nieder wrote:
>> (+cc: Jeff, config parsing wizard)
>
> Ugh, that is not a title that I aspire to. :)

Yes, one day the code will be clean enough that wizardry is not needed. :)

[...]
> But if you require --strip-dashes, then you get potentially differing
> behavior for the same set of options (i.e., one tool may accept "foobar"
> but the other requires "foo-bar", because the latter has not been
> updated to --strip-dashes).
It was a bad idea, so let's do the simple thing.  Like this?
 Documentation/config.txt |    1 +
 builtin/add.c            |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 6a6c0b5..c609de4 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -553,6 +553,7 @@ core.sparseCheckout::
 	Enable "sparse checkout" feature. See section "Sparse checkout" in
 	linkgit:git-read-tree[1] for more information.
 
+add.ignoreErrors::
 add.ignore-errors::
 	Tells 'git add' to continue adding files when some files cannot be
 	added due to indexing errors. Equivalent to the '--ignore-errors'
diff --git a/builtin/add.c b/builtin/add.c
index 71f9b04..21dc1f7 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -331,7 +331,8 @@ static struct option builtin_add_options[] = {
 
 static int add_config(const char *var, const char *value, void *cb)
 {
-	if (!strcasecmp(var, "add.ignore-errors")) {
+	if (!strcasecmp(var, "add.ignoreerrors") ||
+	    !strcasecmp(var, "add.ignore-errors")) {
 		ignore_add_errors = git_config_bool(var, value);
 		return 0;
 	}
-- 
1.7.2.3
Previous: Jeff KingNext: Jeff King
Message 25 of 36 in “cvsimport: partial whitespace cleanup”
  1. 1/3 cvsimport: partial whitespace cleanupMichael J Gruber, Nov 25, 2010
  2. 2/3 cvsimport: fix the parsing of uppercase config optionsMichael J Gruber, Nov 25, 2010
  3. Junio C HamanoNov 27, 2010
  4. Michael J GruberNov 28, 2010
  5. 1/3 cvsimport: partial whitespace cleanupMichael J Gruber, Nov 28, 2010
  6. 2/3 cvsimport: fix the parsing of uppercase config optionsMichael J Gruber, Nov 28, 2010
  7. 3/3 cvsimport.txt: document the mapping between config and optionsMichael J Gruber, Nov 28, 2010
  8. Junio C HamanoNov 29, 2010
  9. Michael J GruberNov 30, 2010
  10. Junio C HamanoDec 1, 2010
  11. 0/3 uppercase config options for cvsimportMichael J Gruber, Dec 1, 2010
  12. 1/3 cvsimport: partial whitespace cleanupMichael J Gruber, Dec 1, 2010
  13. 2/3 cvsimport: fix the parsing of uppercase config optionsMichael J Gruber, Dec 1, 2010
  14. Martin LanghoffDec 1, 2010
  15. Jonathan NiederDec 1, 2010
  16. Martin LanghoffDec 1, 2010
  17. Jakub NarebskiDec 1, 2010
  18. Jonathan NiederDec 1, 2010
  19. Michael J GruberDec 1, 2010
  20. Jonathan NiederDec 1, 2010
  21. Jeff KingDec 1, 2010
  22. Junio C HamanoDec 1, 2010
  23. Junio C HamanoDec 2, 2010
  24. Jeff KingDec 1, 2010
  25. add: introduce add.ignoreerrors synonym for add.ignore-errorsJonathan Nieder, Dec 1, 2010
  26. Jeff KingDec 1, 2010
  27. Jonathan NiederDec 1, 2010
  28. Junio C HamanoDec 1, 2010
  29. Junio C HamanoDec 1, 2010
  30. Jeff KingDec 1, 2010
  31. Junio C HamanoDec 3, 2010
  32. 3/3 cvsimport.txt: document the mapping between config and optionsMichael J Gruber, Dec 1, 2010
  33. Martin LanghoffDec 1, 2010
  34. Michael J GruberDec 1, 2010
  35. 3/3 cvsimport.txt: document the mapping between config and optionsMichael J Gruber, Nov 25, 2010
  36. Junio C HamanoNov 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.