Author: tchemit Date: 2014-05-26 11:57:14 +0200 (Mon, 26 May 2014) New Revision: 76 Url: http://forge.codelutin.com/projects/adminsys/repository/revisions/76 Log: improve rename author script Modified: scripts/git-tools/git-change-authors.sh scripts/git-tools/git-get-authors.sh Modified: scripts/git-tools/git-change-authors.sh =================================================================== --- scripts/git-tools/git-change-authors.sh 2014-05-25 08:34:09 UTC (rev 75) +++ scripts/git-tools/git-change-authors.sh 2014-05-26 09:57:14 UTC (rev 76) @@ -19,28 +19,24 @@ fi if [ ! -d $1 ]; then - echo $1 does not exists + echo $1 does not exist exit 0 fi repo=$(readlink -e $1) -if [ ! -d $repo/refs ]; then - echo "$repo/refs does not exists (probably not a git repository)" - exit 0 -fi +#if [ ! -d $repo/refs ]; then +# echo "$repo/refs does not exist (probably not a git repository)" +# exit 0 +#fi - -change_email() { - oldName=$1 - newCommiterName=$2 - newCommiterEmail=$3 - newAuthorName=$2 - newAuthorEmail=$3 -} - authors_file=$(basename $repo).authors +if [ ! -f $authors_file ]; then + echo "$authors_file does not exist" + exit 0 +fi + script="/tmp/git-change-authors-script.sh" cat << EOF > $script @@ -48,7 +44,7 @@ cd $repo -git filter-branch --force --env-filter ' +git filter-branch --force --tag-name-filter cat --commit-filter ' EOF while read line @@ -71,12 +67,15 @@ done < $authors_file cat << EOF >> $script -' -- --all +git commit-tree "\$@"; +' HEAD + +rm -rf refs/original EOF chmod +x $script echo Execute script $script . $script -rm -rf $script +#rm -rf $script Modified: scripts/git-tools/git-get-authors.sh =================================================================== --- scripts/git-tools/git-get-authors.sh 2014-05-25 08:34:09 UTC (rev 75) +++ scripts/git-tools/git-get-authors.sh 2014-05-26 09:57:14 UTC (rev 76) @@ -33,5 +33,5 @@ file=$(pwd)/$(basename $repo).authors -(cd $repo ; git log --format='%aN:%aN:%ae' | sort -u > $file) +(cd $repo ; git log --all --format='%aN:%aN:%ae' | sort -u > $file) echo "authors saved in $file" \ No newline at end of file
participants (1)
-
tchemit@users.forge.codelutin.com