File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ ifdef::git-default-editor[]
50
50
The build you are using chose '{git-default-editor}' as the default.
51
51
endif::git-default-editor[]
52
52
53
+ GIT_SEQUENCE_EDITOR::
54
+ Text editor used to edit the 'todo' file while running `git rebase
55
+ -i`. Like `GIT_EDITOR`, the value is meant to be interpreted by
56
+ the shell when it is used. The order of preference is the
57
+ `$GIT_SEQUENCE_EDITOR` environment variable, then
58
+ `sequence.editor` configuration, and then the value of `git var
59
+ GIT_EDITOR`.
60
+
53
61
GIT_PAGER::
54
62
Text viewer for use by Git commands (e.g., 'less'). The value
55
63
is meant to be interpreted by the shell. The order of preference
Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ static const char *editor(int flag)
14
14
return git_editor ();
15
15
}
16
16
17
+ static const char * sequence_editor (int flag )
18
+ {
19
+ return git_sequence_editor ();
20
+ }
21
+
17
22
static const char * pager (int flag )
18
23
{
19
24
const char * pgm = git_pager (1 );
@@ -36,6 +41,7 @@ static struct git_var git_vars[] = {
36
41
{ "GIT_COMMITTER_IDENT" , git_committer_info },
37
42
{ "GIT_AUTHOR_IDENT" , git_author_info },
38
43
{ "GIT_EDITOR" , editor },
44
+ { "GIT_SEQUENCE_EDITOR" , sequence_editor },
39
45
{ "GIT_PAGER" , pager },
40
46
{ "GIT_DEFAULT_BRANCH" , default_branch },
41
47
{ "" , NULL },
Original file line number Diff line number Diff line change @@ -109,6 +109,44 @@ test_expect_success 'get GIT_EDITOR with configuration and environment variable
109
109
)
110
110
'
111
111
112
+ test_expect_success ' get GIT_SEQUENCE_EDITOR without configuration' '
113
+ (
114
+ sane_unset GIT_SEQUENCE_EDITOR &&
115
+ git var GIT_EDITOR >expect &&
116
+ git var GIT_SEQUENCE_EDITOR >actual &&
117
+ test_cmp expect actual
118
+ )
119
+ '
120
+
121
+ test_expect_success ' get GIT_SEQUENCE_EDITOR with configuration' '
122
+ test_config sequence.editor foo &&
123
+ (
124
+ sane_unset GIT_SEQUENCE_EDITOR &&
125
+ echo foo >expect &&
126
+ git var GIT_SEQUENCE_EDITOR >actual &&
127
+ test_cmp expect actual
128
+ )
129
+ '
130
+
131
+ test_expect_success ' get GIT_SEQUENCE_EDITOR with environment variable' '
132
+ (
133
+ sane_unset GIT_SEQUENCE_EDITOR &&
134
+ echo bar >expect &&
135
+ GIT_SEQUENCE_EDITOR=bar git var GIT_SEQUENCE_EDITOR >actual &&
136
+ test_cmp expect actual
137
+ )
138
+ '
139
+
140
+ test_expect_success ' get GIT_SEQUENCE_EDITOR with configuration and environment variable' '
141
+ test_config sequence.editor foo &&
142
+ (
143
+ sane_unset GIT_SEQUENCE_EDITOR &&
144
+ echo bar >expect &&
145
+ GIT_SEQUENCE_EDITOR=bar git var GIT_SEQUENCE_EDITOR >actual &&
146
+ test_cmp expect actual
147
+ )
148
+ '
149
+
112
150
# For git var -l, we check only a representative variable;
113
151
# testing the whole output would make our test too brittle with
114
152
# respect to unrelated changes in the test suite's environment.
You can’t perform that action at this time.
0 commit comments