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

[PATCH] add: allow configurations to be overriden by command line

From
Stephen Boyd <bebarino@gmail.com>
Date
Jun 18, 2009, 09:17 UTC
Message-ID
<1245316674-32377-1-git-send-email-bebarino@gmail.com>

Don't call git_config after parsing the command line options, otherwise the config settings will override any settings made by the command line.

This can be seen by setting add.ignore_errors and then specifying --no-ignore-errors when using git-add.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 builtin-add.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-add.c b/builtin-add.c
index c1b229a..56e5221 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -298,6 +298,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	int add_new_files;
 	int require_pathspec;
 
+	git_config(add_config, NULL);
+
 	argc = parse_options(argc, argv, prefix, builtin_add_options,
 			  builtin_add_usage, PARSE_OPT_KEEP_ARGV0);
 	if (patch_interactive)
@@ -305,8 +307,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 	if (add_interactive)
 		exit(interactive_add(argc - 1, argv + 1, prefix));
 
-	git_config(add_config, NULL);
-
 	if (edit_interactive)
 		return(edit_patch(argc, argv, prefix));
 	argc--;
-- 
1.6.3.2.306.g4f4fa
Next: Junio C Hamano
Message 1 of 7 in “add: allow configurations to be overriden by command line”
  1. add: allow configurations to be overriden by command lineStephen Boyd, Jun 18, 2009
  2. Junio C HamanoJun 18, 2009
  3. Stephen BoydJun 18, 2009
  4. Junio C HamanoJun 18, 2009
  5. Stephen BoydJun 18, 2009
  6. t3700-add: add a POSIXPERM prerequisite to a new testJohannes Sixt, Jun 22, 2009
  7. Junio C HamanoJun 22, 2009

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.