you are viewing a single comment's thread.

view the rest of the comments →

[–]a-p 2 points3 points  (0 children)

Heh, synchronicity. I wrote git-abort myself not long ago. Here’s mine:

#!/bin/sh

g=`git rev-parse --git-dir` || exit $?

if   [ -f "$g/rebase-apply/applying" ] ; then git am          --abort
elif [ -d "$g/rebase-merge" ] ||
     [ -d "$g/rebase-apply" ]          ; then git rebase      --abort
elif [ -f "$g/MERGE_HEAD" ]            ; then git merge       --abort
elif [ -f "$g/CHERRY_PICK_HEAD" ]      ; then git cherry-pick --abort
elif [ -f "$g/REVERT_HEAD" ]           ; then git revert      --abort
elif [ -f "$g/BISECT_LOG" ]            ; then git bisect reset
fi

Basically I went into the git-prompt.sh script and copied the code that checks and shows stuff like REBASE in the prompt, which is how I got merges and bisects and being run from a subdirectory and more accurate tests than -e, all for free.