forked from xapi-project/xen-api-libs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script which can fix the broken commits in this repository
Note the resulting hashes are (of course) different.
- Loading branch information
David Scott
committed
Jan 8, 2013
1 parent
b0152df
commit 24df392
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <Jon Ludlam <Jonathan.Ludlam@eu.citrix.com' | ||
|
||
git filter-branch -f --commit-filter ' | ||
echo "id = $GIT_COMMIT committer date = $GIT_COMMITTER_DATE" >> /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 |