Skip to content

Commit 9ee3d37

Browse files
committed
Merge branch 'po/insn-editor'
* po/insn-editor: "rebase -i": support special-purpose editor to edit insn sheet
2 parents 0445ba2 + 821881d commit 9ee3d37

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Documentation/config.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ core.editor::
474474
variable when it is set, and the environment variable
475475
`GIT_EDITOR` is not set. See linkgit:git-var[1].
476476

477+
sequence.editor::
478+
Text editor used by `git rebase -i` for editing the rebase insn file.
479+
The value is meant to be interpreted by the shell when it is used.
480+
It can be overridden by the `GIT_SEQUENCE_EDITOR` environment variable.
481+
When not configured the default commit message editor is used instead.
482+
477483
core.pager::
478484
The command that git will use to paginate output. Can
479485
be overridden with the `GIT_PAGER` environment

git-rebase--interactive.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,19 @@ do_with_author () {
161161
)
162162
}
163163

164+
git_sequence_editor () {
165+
if test -z "$GIT_SEQUENCE_EDITOR"
166+
then
167+
GIT_SEQUENCE_EDITOR="$(git config sequence.editor)"
168+
if [ -z "$GIT_SEQUENCE_EDITOR" ]
169+
then
170+
GIT_SEQUENCE_EDITOR="$(git var GIT_EDITOR)" || return $?
171+
fi
172+
fi
173+
174+
eval "$GIT_SEQUENCE_EDITOR" '"$@"'
175+
}
176+
164177
pick_one () {
165178
ff=--ff
166179
case "$1" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac
@@ -832,7 +845,7 @@ has_action "$todo" ||
832845
die_abort "Nothing to do"
833846

834847
cp "$todo" "$todo".backup
835-
git_editor "$todo" ||
848+
git_sequence_editor "$todo" ||
836849
die_abort "Could not execute editor"
837850

838851
has_action "$todo" ||

0 commit comments

Comments
 (0)