comparison extra/soundsoftware/export-git.sh @ 1561:6074fffd8a1d feature_1136

No, a bare repo is better
author Chris Cannam
date Thu, 14 Jan 2016 12:03:06 +0000
parents 2c67e414ab46
children
comparison
equal deleted inserted replaced
1560:2c67e414ab46 1561:6074fffd8a1d
76 76
77 reponame=$(basename "$hgrepo") 77 reponame=$(basename "$hgrepo")
78 authormap="$authordir/authormap_$reponame" 78 authormap="$authordir/authormap_$reponame"
79 79
80 git_repodir="$gitdir/$reponame" 80 git_repodir="$gitdir/$reponame"
81 git_workdir="$gitdir/$reponame.workdir"
82 81
83 if [ ! -f "$authormap" ]; then 82 if [ ! -f "$authormap" ]; then
84 echo "No authormap file was created for repo $reponame, skipping" 83 echo "No authormap file was created for repo $reponame, skipping"
85 84
86 # If there is no authormap file, then we should not have a git 85 # If there is no authormap file, then we should not have a git
94 93
95 continue 94 continue
96 fi 95 fi
97 96
98 if [ ! -d "$git_repodir" ]; then 97 if [ ! -d "$git_repodir" ]; then
99 git init --separate-git-dir="$git_repodir" "$git_workdir" 98 git init --bare "$git_repodir"
100 fi 99 fi
101 100
102 echo 101 echo
103 echo "About to run fast export for repo $reponame..." 102 echo "About to run fast export for repo $reponame..."
104 103
105 ( 104 (
106 cd "$git_workdir" 105 cd "$git_repodir"
107 106
108 # Force is necessary because git-fast-import (or git) can't handle 107 # Force is necessary because git-fast-import (or git) can't handle
109 # branches having more than one head ("Error: repository has at 108 # branches having more than one head ("Error: repository has at
110 # least one unnamed head"), which happens from time to time in 109 # least one unnamed head"), which happens from time to time in
111 # valid Hg repos. With --force apparently it will just pick one 110 # valid Hg repos. With --force apparently it will just pick one