Use sequence.editor to control the rebase -i editor without changing the commit / reword editor

This commit is contained in:
Georges Dupéron 2018-03-15 09:29:40 +01:00
parent ec844189f5
commit 3d2a2f2ba6
4 changed files with 10 additions and 11 deletions

View File

@ -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`

View File

@ -1,2 +1,2 @@
[alias]
rebasei = "!git-rebasei"
[sequence]
editor = git-rebasei-editor

View File

@ -1,3 +0,0 @@
#!/bin/bash
GIT_REBASE_I_EDITOR="${EDITOR:-editor}" EDITOR="git-rebasei-editor" git rebase -i "$@"

View File

@ -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