forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripts to fix the broken commits in this repo
The result of this can be pushed to github and passes a "git fsck"
- Loading branch information
David Scott
committed
Jan 8, 2013
1 parent
3921792
commit 04849db
Showing
2 changed files
with
28 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,24 @@ | ||
#!/bin/bash | ||
|
||
export FIX_DATE=`pwd`/../fix-date.sh | ||
[ -x $FIX_DATE ] || exit 1 | ||
# xen-api fails a "git fsck" because it has bad timezone data in commit timestamps:: | ||
# '@ <Jonathan Ludlam <Jonathan.Ludlam@eu.citrix.com> > 1255377615 +0100' | ||
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 | ||
GIT_COMMITTER_DATE2=$(${FIX_DATE} "${GIT_COMMITTER_DATE}") | ||
GIT_AUTHOR_DATE2=$(${FIX_DATE} "${GIT_AUTHOR_DATE}") | ||
if [ "${GIT_COMMITTER_DATE}" != "${GIT_COMMITTER_DATE2}" ]; | ||
then | ||
echo "Rewriting ${GIT_COMMITTER_DATE} > ${GIT_COMMITTER_DATE2}" >> /tmp/foo | ||
export GIT_COMMITTER_DATE="${GIT_COMMITTER_DATE2}" | ||
fi | ||
if [ "${GIT_AUTHOR_DATE}" != "${GIT_AUTHOR_DATE2}" ]; | ||
then | ||
echo "Rewriting ${GIT_AUTHOR_DATE} > ${GIT_AUTHOR_DATE2}" >> /tmp/foo | ||
export GIT_AUTHOR_DATE="${GIT_AUTHOR_DATE2}" | ||
fi | ||
git commit-tree "$@"; | ||
' --tag-name-filter cat -- --all | ||
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune |
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,4 @@ | ||
#!/bin/sh | ||
|
||
echo "$1" | sed -r 's/.*@[^0-9]*([0-9]+ [+-][0-9]+)/@\1/g' | ||
|