summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62e09ce)
raw | patch | inline | side by side (parent: 62e09ce)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 20 Jul 2007 12:06:09 +0000 (13:06 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 21 Jul 2007 23:51:14 +0000 (16:51 -0700) |
In the commit 'Add GIT_EDITOR environment and core.editor
configuration variables', this was done for the shell scripts.
Port it over to builtin-tag's version of launch_editor(), which
is just about to be refactored into editor.c.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
configuration variables', this was done for the shell scripts.
Port it over to builtin-tag's version of launch_editor(), which
is just about to be refactored into editor.c.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-tag.c | patch | blob | history | |
cache.h | patch | blob | history | |
config.c | patch | blob | history | |
environment.c | patch | blob | history |
diff --git a/builtin-tag.c b/builtin-tag.c
index 507f51076da92f241859ed940e5332f79278e092..81d37ce9015d108ac16038cb6c9e12a6b4a197b9 100644 (file)
--- a/builtin-tag.c
+++ b/builtin-tag.c
const char *args[3];
int fd;
- editor = getenv("VISUAL");
+ editor = getenv("GIT_EDITOR");
+ if (!editor && editor_program)
+ editor = editor_program;
+ if (!editor)
+ editor = getenv("VISUAL");
if (!editor)
editor = getenv("EDITOR");
char *message, int sign, unsigned char *result)
{
enum object_type type;
- char header_buf[1024], *buffer;
+ char header_buf[1024], *buffer = NULL;
int header_len, max_size;
- unsigned long size;
+ unsigned long size = 0;
type = sha1_object_info(object, NULL);
if (type <= 0)
index 53801b8089e0fbea5e36414432ef9aa7d1313781..67b1af16d9f06a76ed9616df9c96ce4b1f839bd4 100644 (file)
--- a/cache.h
+++ b/cache.h
extern int pager_in_use;
extern int pager_use_color;
+extern char *editor_program;
+
/* base85 */
int decode_85(char *dst, const char *line, int linelen);
void encode_85(char *buf, const unsigned char *data, int bytes);
diff --git a/config.c b/config.c
index f89a61191591c1242ba8fb3ac5b03330cdb1c06b..103b4fcc61192d18c63b198a5eb37bbdf154a6b0 100644 (file)
--- a/config.c
+++ b/config.c
return 0;
}
+ if (!strcmp(var, "core.editor")) {
+ editor_program = xstrdup(value);
+ return 0;
+ }
+
/* Add other config variables here and to Documentation/config.txt. */
return 0;
}
diff --git a/environment.c b/environment.c
index f83fb9e44806c03cde06eede7888a4dcb901c5c3..35d3f4b595872c39c640ca0f71e7846d3ad053f2 100644 (file)
--- a/environment.c
+++ b/environment.c
char *pager_program;
int pager_in_use;
int pager_use_color = 1;
+char *editor_program;
int auto_crlf = 0; /* 1: both ways, -1: only when adding git objects */
static const char *git_dir;