diff options
| author | Sean Allred <allred.sean@gmail.com> | 2022-12-17 23:09:59 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-12-18 11:48:26 +0900 |
| commit | 4c3dd9304e49402bd4ee19dfaa4c21d0217fb582 (patch) | |
| tree | 9c3ec1efa172c19c821375a83e9c865991bb833f /builtin/var.c | |
| parent | 57e2c6ebbe7108b35ba30184dcbcb6c34c929ad8 (diff) | |
| download | git-4c3dd9304e49402bd4ee19dfaa4c21d0217fb582.tar.xz | |
var: add GIT_SEQUENCE_EDITOR variable
The editor program used by Git when editing the sequencer "todo" file
is determined by examining a few environment variables and also
affected by configuration variables. Introduce "git var
GIT_SEQUENCE_EDITOR" to give users access to the final result of the
logic without having to know the exact details.
This is very similar in spirit to 44fcb497 (Teach git var about
GIT_EDITOR, 2009-11-11) that introduced "git var GIT_EDITOR".
Signed-off-by: Sean Allred <allred.sean@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/var.c')
| -rw-r--r-- | builtin/var.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/var.c b/builtin/var.c index a1a2522126..a80c1df86f 100644 --- a/builtin/var.c +++ b/builtin/var.c @@ -14,6 +14,11 @@ static const char *editor(int flag) return git_editor(); } +static const char *sequence_editor(int flag) +{ + return git_sequence_editor(); +} + static const char *pager(int flag) { const char *pgm = git_pager(1); @@ -36,6 +41,7 @@ static struct git_var git_vars[] = { { "GIT_COMMITTER_IDENT", git_committer_info }, { "GIT_AUTHOR_IDENT", git_author_info }, { "GIT_EDITOR", editor }, + { "GIT_SEQUENCE_EDITOR", sequence_editor }, { "GIT_PAGER", pager }, { "GIT_DEFAULT_BRANCH", default_branch }, { "", NULL }, |
