How fix git log after use hg-fast-export.sh?
my git repo seem to be corrupted.
$ git push -u origin master
Counting objects: 16157, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5794/5794), done.
error: object 7e2ee8b2364db1cab7a340a1d5d26cd40aa0deff:invalid author/committer line - bad date
fatal: Error in object
error: pack-objects died of signal 13
$ git cat-file -p 7e2ee8b2364db1cab7a340a1d5d26cd40aa0deff
tree 00258b开发者_如何学Cdecaf83c001ae1be7dbedbd0eeee25c373
parent 7d15e8d2ea1ff5ef98a0996ed14b8b236f1461ec
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> <Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>> 1219589646 +0200
committer Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> <Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>> 1219589646 +0200
Add __APPLE__ to most #if linux compile time switches.
So email seem to be wrong, how i can fix it by Jacob Carlborg ?
seem to be fixed with
#!/usr/bin/env bash
git filter-branch --env-filter '
get_name () {
grep "^$1=" "$authors_file" |
sed "s/^.*=\(.*\) <.*>$/\1/"
}
get_email () {
grep "^$1=" "$authors_file" |
sed "s/^.*=.* <\(.*\)>$/\1/"
}
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ $GIT_COMMIT = "7e2ee8b2364db1cab7a340a1d5d26cd40aa0deff" ]
then
cn="Jacob Carlborg"
cm="<jacob.carlborg@gmail.com>"
an="Jacob Carlborg"
am="<jacob.carlborg@gmail.com>"
else
cn="$GIT_AUTHOR_NAME"
cm="$GIT_AUTHOR_EMAIL"
an="$GIT_AUTHOR_NAME"
am="get_email $GIT_COMMITTER_NAME"
fi
export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
'
else block could be removed
精彩评论