summaryrefslogtreecommitdiff
path: root/badcommit-fixup
diff options
context:
space:
mode:
Diffstat (limited to 'badcommit-fixup')
-rwxr-xr-xbadcommit-fixup20
1 files changed, 11 insertions, 9 deletions
diff --git a/badcommit-fixup b/badcommit-fixup
index 9cc61a9..5b31614 100755
--- a/badcommit-fixup
+++ b/badcommit-fixup
@@ -29,7 +29,13 @@ esac
args="$nots"
-for head in HEAD `git-for-each-ref --format='%(refname)'`; do
+refs=`git-for-each-ref --format='%(refname)'`
+
+if git-symbolic-ref HEAD >/dev/null 2>&1; then
+ refs+=' HEAD'
+fi
+
+for head in $refs; do
exec <$tmp/bad
needed=false
for bad in $bads; do
@@ -42,14 +48,10 @@ for head in HEAD `git-for-each-ref --format='%(refname)'`; do
args+=" $head"
done
-cat >$tmp/flt <<'END'
-#!/usr/bin/perl -w
-use strict;
-undef $/;
-$_ = <STDIN>;
-s/^(\w+.*\n)*commiter /$1committer /;
-END
-
git filter-branch --original dgit-badcommit --commit-filter '
+echo >&2 "FOO $*"
+cat >&2
+echo >&2 ====
+false
sed -e '\''1,/^$/ s/^commiter /committer /'\''
' $args