commit 3d2a2f2ba641f5554ad3a1ae91c97f6d855f26d4
parent ec844189f5c74248786761489aa83e9709e99184
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Thu, 15 Mar 2018 09:29:40 +0100
Use sequence.editor to control the rebase -i editor without changing the commit / reword editor
Diffstat:
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
@@ -8,3 +8,9 @@ git-rebasei
===========
A small wrapper around git rebase -i to show commits in the same order and with the same information as git log --oneline --decorate
+
+To enable:
+
+ git config --global sequence.editor git-rebasei-editor
+
+and make sure that `git-rebasei-editor` is in your `$PATH`
+\ No newline at end of file
diff --git a/dot.gitconfig b/dot.gitconfig
@@ -1,2 +1,2 @@
-[alias]
- rebasei = "!git-rebasei"
+[sequence]
+ editor = git-rebasei-editor
diff --git a/git-rebasei b/git-rebasei
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-GIT_REBASE_I_EDITOR="${EDITOR:-editor}" EDITOR="git-rebasei-editor" git rebase -i "$@"
diff --git a/git-rebasei-editor b/git-rebasei-editor
@@ -1,13 +1,7 @@
#!/bin/bash
-export EDITOR="$GIT_REBASE_I_EDITOR"
-
tempfile="$(tempfile)"
-if ! (cat "$1" | grep -q "Rebase .* onto .* (.* command(s))"); then
- exec editor "$@"
-fi
-
# how can I get the --graph with only the desired commits?
cat "$1" \
@@ -24,6 +18,8 @@ echo >> "$tempfile"
echo "# Originial git rebase -i data:" >> "$tempfile"
cat "$1" | sed -e 's/^/#/' >> "$tempfile"
+echo "# GIT file: $1" >> "$tempfile"
+
editor "$tempfile"
# p, pick