Index: tools/tools/git/arcgit =================================================================== --- tools/tools/git/arcgit +++ tools/tools/git/arcgit @@ -69,7 +69,7 @@ git checkout $commit > /dev/null || error "Could not checkout $commit" - arc_dir="$(git rev-parse --show-toplevel)/.git/arc" + arc_dir="$(git rev-parse --git-dir)/arc" arc_msg="$arc_dir/create-message" mkdir -p $arc_dir git show -s --format='%B' HEAD > $arc_msg Index: tools/tools/git/importgit =================================================================== --- tools/tools/git/importgit +++ tools/tools/git/importgit @@ -95,16 +95,14 @@ error -u "-g argument is mandatory" fi -git="$git_repo/.git" - -if [ ! -d "$git" ] +if ! type git > /dev/null 2> /dev/null then - error "$git_repo does not seem to be a git repo" + error "Install devel/git first" fi -if ! type git > /dev/null 2> /dev/null +if ! git -C $git_repo rev-parse --git-dir 2> /dev/null > /dev/null then - error "Install devel/git first" + error "$git_repo does not seem to be a git repo" fi if ! type svn > /dev/null 2> /dev/null @@ -122,21 +120,21 @@ error "Could not communicate with svn server. Is your ssh key loaded?" fi -git --git-dir=$git log --format=%H $range | tail -r | while read -r commit +git -C $git_repo log --format=%H $range | tail -r | while read -r commit do - echo "Applying `git --git-dir=$git show -s --oneline $commit`" + echo "Applying `git -C $git_repo show -s --oneline $commit`" - if [ -n "$(git --git-dir=$git show --diff-filter=CDRTUXB $commit)" ] + if [ -n "$(git -C $git_repo show --diff-filter=CDRTUXB $commit)" ] then error "Commit performed unsupported change (e.g. delete/rename)" fi - if [ "$(git --git-dir=$git show -s --format=%P $commit | wc -w)" -ne 1 ] + if [ "$(git -C $git_repo show -s --format=%P $commit | wc -w)" -ne 1 ] then error "Cannot import merge commits" fi - git --git-dir=$git diff --diff-filter=A --name-only \ + git -C $git_repo diff --diff-filter=A --name-only \ ${commit}~..$commit | while read -r newfile do if [ -f "$newfile" ] @@ -158,10 +156,10 @@ continue fi - git --git-dir=$git show $commit | patch -p 1 -s || \ + git -C $git_repo show $commit | patch -p 1 -s || \ error "Failed to apply patch" - git --git-dir=$git diff --diff-filter=A --name-only \ + git -C $git_repo diff --diff-filter=A --name-only \ ${commit}~..$commit | while read -r newfile do svn add --parents --depth=infinity $newfile || \ @@ -176,7 +174,7 @@ exit $ret fi - git --git-dir=$git show -s --format='%B' $commit | svn commit -F - || \ + git -C $git_repo show -s --format='%B' $commit | svn commit -F - || \ error "Failed to commit" done