diff --git a/README.md b/README.md index d5bf25e..0965daf 100644 --- 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 index 52d0cf8..a9e2df6 100644 --- 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 deleted file mode 100755 index 6a1ed0c..0000000 --- a/git-rebasei +++ /dev/null @@ -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 index f1d34fd..553277a 100755 --- 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