summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-21 16:04:37 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-21 16:04:37 -0700
commit9ee3d3774316f6a60c0618aa7a64fc7a59a8f338 (patch)
tree5aa9c4b308d4d084a1d10d718906c86e2b4b711f
parent0445ba2457b066a70334877f2d638e1f7a974220 (diff)
parent821881d88d3012a64a52ece9a8c2571ca00c35cd (diff)
downloadgit-9ee3d3774316f6a60c0618aa7a64fc7a59a8f338.tar.gz
Merge branch 'po/insn-editor'
* po/insn-editor: "rebase -i": support special-purpose editor to edit insn sheet
-rw-r--r--Documentation/config.txt6
-rw-r--r--git-rebase--interactive.sh15
2 files changed, 20 insertions, 1 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 9c81fffc61..5a841da6d4 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -474,6 +474,12 @@ core.editor::
variable when it is set, and the environment variable
`GIT_EDITOR` is not set. See linkgit:git-var[1].
+sequence.editor::
+ Text editor used by `git rebase -i` for editing the rebase insn file.
+ The value is meant to be interpreted by the shell when it is used.
+ It can be overridden by the `GIT_SEQUENCE_EDITOR` environment variable.
+ When not configured the default commit message editor is used instead.
+
core.pager::
The command that git will use to paginate output. Can
be overridden with the `GIT_PAGER` environment
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 94f36c254c..804001bb4e 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -161,6 +161,19 @@ do_with_author () {
)
}
+git_sequence_editor () {
+ if test -z "$GIT_SEQUENCE_EDITOR"
+ then
+ GIT_SEQUENCE_EDITOR="$(git config sequence.editor)"
+ if [ -z "$GIT_SEQUENCE_EDITOR" ]
+ then
+ GIT_SEQUENCE_EDITOR="$(git var GIT_EDITOR)" || return $?
+ fi
+ fi
+
+ eval "$GIT_SEQUENCE_EDITOR" '"$@"'
+}
+
pick_one () {
ff=--ff
case "$1" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac
@@ -832,7 +845,7 @@ has_action "$todo" ||
die_abort "Nothing to do"
cp "$todo" "$todo".backup
-git_editor "$todo" ||
+git_sequence_editor "$todo" ||
die_abort "Could not execute editor"
has_action "$todo" ||