Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 25 lines (23 sloc) 1.082 kb
04849db @djs55 Scripts to fix the broken commits in this repo
djs55 authored
1 #!/bin/bash
2
3 export FIX_DATE=`pwd`/../fix-date.sh
4 [ -x $FIX_DATE ] || exit 1
5 # xen-api fails a "git fsck" because it has bad timezone data in commit timestamps::
6 # '@ <Jonathan Ludlam <Jonathan.Ludlam@eu.citrix.com> > 1255377615 +0100'
7 git filter-branch -f --commit-filter '
8 echo "id = $GIT_COMMIT committer date = $GIT_COMMITTER_DATE" >> /tmp/foo
9 echo "id = $GIT_COMMIT author date = $GIT_AUTHOR_DATE" >> /tmp/foo
10 GIT_COMMITTER_DATE2=$(${FIX_DATE} "${GIT_COMMITTER_DATE}")
11 GIT_AUTHOR_DATE2=$(${FIX_DATE} "${GIT_AUTHOR_DATE}")
12 if [ "${GIT_COMMITTER_DATE}" != "${GIT_COMMITTER_DATE2}" ];
13 then
14 echo "Rewriting ${GIT_COMMITTER_DATE} > ${GIT_COMMITTER_DATE2}" >> /tmp/foo
15 export GIT_COMMITTER_DATE="${GIT_COMMITTER_DATE2}"
16 fi
17 if [ "${GIT_AUTHOR_DATE}" != "${GIT_AUTHOR_DATE2}" ];
18 then
19 echo "Rewriting ${GIT_AUTHOR_DATE} > ${GIT_AUTHOR_DATE2}" >> /tmp/foo
20 export GIT_AUTHOR_DATE="${GIT_AUTHOR_DATE2}"
21 fi
22 git commit-tree "$@";
23 ' --tag-name-filter cat -- --all
24 rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
Something went wrong with that request. Please try again.