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

[PATCH A v4 2/5] git config: trivial cleanup for editor action

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Feb 21, 2009, 00:48 UTC
Message-ID
<1235177337-2532-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1235177337-2532-2-git-send-email-felipe.contreras@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin-config.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/builtin-config.c b/builtin-config.c
index afc4393..d52a057 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -363,15 +363,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		} else if (!strcmp(argv[1], "--get-colorbool")) {
 			return get_colorbool(argc-2, argv+2);
 		} else if (!strcmp(argv[1], "--edit") || !strcmp(argv[1], "-e")) {
-			const char *config_filename;
 			if (argc != 2)
 				usage(git_config_set_usage);
-			if (config_exclusive_filename)
-				config_filename = config_exclusive_filename;
-			else
-				config_filename = git_path("config");
 			git_config(git_default_config, NULL);
-			launch_editor(config_filename, NULL, NULL);
+			launch_editor(config_exclusive_filename ?
+				      config_exclusive_filename : git_path("config"),
+				      NULL, NULL);
 			return 0;
 		} else
 			break;
-- 
1.6.1.3
Previous: Felipe ContrerasNext: Felipe Contreras
Message 3 of 6 in “git config: cleanups”
  1. 0/5 git config: cleanupsFelipe Contreras, Feb 21, 2009
  2. 1/5 git config: codestyle cleanupsFelipe Contreras, Feb 21, 2009
  3. 2/5 git config: trivial cleanup for editor actionFelipe Contreras, Feb 21, 2009
  4. 3/5 git_config(): not having a per-repo config file is not an errorFelipe Contreras, Feb 21, 2009
  5. 4/5 git config: trivial rename in preparation for parseoptFelipe Contreras, Feb 21, 2009
  6. 5/5 git config: reorganize get_color*Felipe Contreras, Feb 21, 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.