Mirroring a git repository

Asked by Robie Basak on 2012-04-05

Hello!

I am trying to understand how to use bzr-fastimport to keep a mirror of a git repository.

The first import works fine. If the git repository then moves forward, the second attempt causes bzr-fastimport to crash.

What am I doing wrong?

Here's my test case that reproduces the problem. Run this in an empty directory:

#!/bin/sh
set -ex

# Make a test git repository with one commit
mkdir git
cd git
git init
echo foo > foo
git add foo
git commit -mfoo
cd ..

# Export it (with an empty marks file)
>marks
cd git
git fast-export --import-marks=../marks --export-marks=../marks -M -C --all > ../fi
cd ..

# Import into a fresh bzr repository
mkdir bzr
cd bzr
bzr fast-import - < ../fi

# Make one test change to the git repository
cd ../git
echo bar > foo
git commit -mbar foo

# Re-export the git repository, using the previous marks file (so all IDs match)
git fast-export --import-marks=../marks --export-marks=../marks -M -C --all > ../fi

# Resume the import into the bzr repository (this crashes)
cd ../bzr
bzr fast-import - < ../fi

# The exception I get:
# BadRestart: Bad restart - attempted to skip commit 4 but matching revision-id is unknown

Question information

Language:
English Edit question
Status:
Expired
For:
Bazaar Fast Import Edit question
Assignee:
No assignee Edit question
Last query:
2012-04-05
Last reply:
2012-04-21
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.