From 24df392ee6e62414cfc5bc18f97b26e5918543c7 Mon Sep 17 00:00:00 2001 From: David Scott Date: Tue, 8 Jan 2013 14:32:24 +0000 Subject: [PATCH] Add script which can fix the broken commits in this repository Note the resulting hashes are (of course) different. --- fix-broken-commits.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 fix-broken-commits.sh diff --git a/fix-broken-commits.sh b/fix-broken-commits.sh new file mode 100755 index 0000000..15dc5b3 --- /dev/null +++ b/fix-broken-commits.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# xen-api-libs fails a "git fsck" because it has bad author and committer +# email addresses of the form: +export BAD='Jonathan.Ludlam@eu.citrix.com > /tmp/foo + echo "id = $GIT_COMMIT author date = $GIT_AUTHOR_DATE" >> /tmp/foo + echo "id = $GIT_COMMIT committer email = \"$GIT_COMMITTER_EMAIL\"" >> /tmp/foo + echo "id = $GIT_COMMIT author email = \"$GIT_AUTHOR_EMAIL\"" >> /tmp/foo + if [ "${GIT_COMMITTER_EMAIL}" = "${BAD}" ] + then + export GIT_COMMITTER_NAME="Jonathan Ludlam" + export GIT_AUTHOR_NAME="Jonathan Ludlam" + export GIT_COMMITTER_EMAIL="Jonathan.Ludlam@eu.citrix.com" + export GIT_AUTHOR_EMAIL="Jonathan.Ludlam@eu.citrix.com" + echo Rewrote >> /tmp/foo + fi + git commit-tree "$@"; +' --tag-name-filter cat -- --all + +rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune