git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Jakub Narebski <jnareb@gmail.com>,
	Martin Langhoff <martin.langhoff@gmail.com>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] add: introduce add.ignoreerrors synonym for add.ignore-errors
Date: Wed, 1 Dec 2010 12:36:15 -0600	[thread overview]
Message-ID: <20101201183615.GA27024@burratino> (raw)
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

  reply	other threads:[~2010-12-01 18:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 15:10 [PATCH 1/3] cvsimport: partial whitespace cleanup Michael J Gruber
2010-11-25 15:10 ` [PATCH 2/3] cvsimport: fix the parsing of uppercase config options Michael J Gruber
2010-11-27  6:38   ` Junio C Hamano
2010-11-28 19:30     ` Michael J Gruber
2010-11-28 19:39       ` [PATCHv2 1/3] cvsimport: partial whitespace cleanup Michael J Gruber
2010-11-28 19:39         ` [PATCHv2 2/3] cvsimport: fix the parsing of uppercase config options Michael J Gruber
2010-11-28 19:39         ` [PATCHv2 3/3] cvsimport.txt: document the mapping between config and options Michael J Gruber
2010-11-29 20:23           ` Junio C Hamano
2010-11-30  7:56             ` Michael J Gruber
2010-12-01  1:43               ` Junio C Hamano
2010-12-01 12:53                 ` [PATCHv3 0/3] uppercase config options for cvsimport Michael J Gruber
2010-12-01 12:53                   ` [PATCHv3 1/3] cvsimport: partial whitespace cleanup Michael J Gruber
2010-12-01 12:53                   ` [PATCHv3 2/3] cvsimport: fix the parsing of uppercase config options Michael J Gruber
2010-12-01 14:59                     ` Martin Langhoff
2010-12-01 16:05                       ` Jonathan Nieder
2010-12-01 16:18                         ` Martin Langhoff
2010-12-01 16:23                         ` Jakub Narebski
2010-12-01 16:34                           ` Jonathan Nieder
2010-12-01 16:52                             ` Michael J Gruber
2010-12-01 17:01                               ` Jonathan Nieder
2010-12-01 17:58                               ` Jeff King
2010-12-01 19:47                                 ` Junio C Hamano
2010-12-02 21:46                                   ` Junio C Hamano
2010-12-01 17:55                             ` Jeff King
2010-12-01 18:36                               ` Jonathan Nieder [this message]
2010-12-01 18:46                                 ` [PATCH] add: introduce add.ignoreerrors synonym for add.ignore-errors Jeff King
2010-12-01 18:57                                   ` Jonathan Nieder
2010-12-01 19:56                                     ` Junio C Hamano
2010-12-01 20:09                                     ` Junio C Hamano
2010-12-01 21:07                                       ` Jeff King
2010-12-03  2:18                                       ` Junio C Hamano
2010-12-01 12:53                   ` [PATCHv3 3/3] cvsimport.txt: document the mapping between config and options Michael J Gruber
2010-12-01 15:02                 ` [PATCHv2 " Martin Langhoff
2010-12-01 15:34                   ` Michael J Gruber
2010-11-25 15:10 ` [PATCH " Michael J Gruber
2010-11-27  6:33 ` [PATCH 1/3] cvsimport: partial whitespace cleanup Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101201183615.GA27024@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=martin.langhoff@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).