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

[PATCH v2] replace --edit: respect core.editor

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 20, 2016, 06:38 UTC
Message-ID
<a7b889d525f99fecfb9d4a890fd2a5d4bf3001e0.1461134258.git.johannes.schindelin@gmx.de>
In-Reply-To
<909769abaff1babdab77625bebd04e2013c6e344.1461076425.git.johannes.schindelin@gmx.de>
We simply need to read the config, is all.
This fixes https://github.com/git-for-windows/git/issues/733
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/replace.c | 1 +
 1 file changed, 1 insertion(+)
Interdiff vs v1:
 diff --git a/builtin/replace.c b/builtin/replace.c
 index 02b13f6..b58c714 100644
 --- a/builtin/replace.c
 +++ b/builtin/replace.c
 @@ -440,6 +440,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
  	};
  
  	check_replace_refs = 0;
 +	git_config(git_default_config, NULL);
  
  	argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
  
 @@ -475,7 +476,6 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
  		return replace_object(argv[0], argv[1], force);
  
  	case MODE_EDIT:
 -		git_config(git_default_config, NULL);
  		if (argc != 1)
  			usage_msg_opt("-e needs exactly one argument",
  				      git_replace_usage, options);
diff --git a/builtin/replace.c b/builtin/replace.c
index 748c6ca..b58c714 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -440,6 +440,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
 	};
 
 	check_replace_refs = 0;
+	git_config(git_default_config, NULL);
 
 	argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
 
-- 
2.8.1.207.g7b140d3
Previous: Junio C HamanoNext: Jeff King
Message 8 of 10 in “replace --edit: respect core.editor”
  1. replace --edit: respect core.editorJohannes Schindelin, Apr 19, 2016
  2. Junio C HamanoApr 19, 2016
  3. Jeff KingApr 20, 2016
  4. Christian CouderApr 20, 2016
  5. Johannes SchindelinApr 20, 2016
  6. Johannes SchindelinApr 20, 2016
  7. Junio C HamanoApr 20, 2016
  8. replace --edit: respect core.editorJohannes Schindelin, Apr 20, 2016
  9. Jeff KingApr 20, 2016
  10. Junio C HamanoApr 20, 2016

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.