fixup.cc5711424b7ae36276a40c06ede5d95f87ca20f0
[git/dscho.git] / my-fake-history.sh
blobe108ce99a5ebd75230c3cfc56b88d9769fec8bc1
1 #!/bin/sh
3 # Given the output of git-rev-list, this reconstructs the DAG of the history
5 i=0
6 tac | while read rev parents; do
7 let i=$i+1
8 echo $i > a1
9 git add a1
10 tree=$(git write-tree)
11 parents="$(for parent in $parents
13 echo -n "-p $(git rev-parse sp-$parent) "
14 done)"
15 commit=$(echo "$rev $i" | git commit-tree $tree $parents)
16 git tag sp-$rev $commit
17 done