Skip to content

Instantly share code, notes, and snippets.

@usmonster
Last active January 4, 2016 20:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usmonster/8674126 to your computer and use it in GitHub Desktop.
Save usmonster/8674126 to your computer and use it in GitHub Desktop.
Steps to export Vesuvius from LP to GH. Result here: https://github.com/usmonster/vesuvius-test
# Steps to export Vesuvius from LP to GH.
# Replace [username] and ~/path/to/vesuvius with the appropriate values.
# NOTE: This is NOT a script, but a series of commands you should run by hand.
# Also, much of this was found on http://flexion.org/posts/2012-10-migrating-bzr-to-git.html .
# get the tools
sudo apt-get update
sudo apt-get install bzr-fastimport # adds fast-export to bzr if you don't already have it
sudo apt-get upgrade git # make sure git is the most current!
# initialize an empty local git repo
mkdir vesuvius-test.git
cd vesuvius-test.git
git init
# Now go to https://github.com/new and create an empty repo named vesuvius-test .
# Make sure the description includes a link to the official main project page.
# export vesuvius from your local bzr checkout to the new local git repo (tell me if you see errors)
bzr fast-export --plain /path/to/vesuvius | git fast-import
git reset --hard # get the actual files to show up
# migrate .bzrignore to .gitignore
git mv .bzrignore .gitignore
echo >> .gitignore
echo "# Keep empty directories:" >> .gitignore
echo "!*/.git*" >> .gitignore
# adds .gitkeep file to empty directories so git doesn't exclude them
#find -empty -type d -not -iwholename '*.git*' -exec touch '{}/.gitkeep' ";"
#git add **/.gitkeep
## ^unnecessary, but found one directory after doing a manual find on the bzr branch:
mkdir vesuvius/www/pingfm
touch vesuvius/www/pingfm/.gitkeep
git add **/.gitkeep
# commit the newly migrated repository
git commit --all -m "Migrated from Bazaar to Git."
# OPTIONAL: reset index, cleanup & optimize the local repo (recommended somewhere)
git rm --cached -r .
git reset --hard
git gc --aggressive --prune=now
# ALMOST THERE: Do a sanity check now before proceeding.
# FINALLY: push the repo to GitHub
git remote add origin git@github.com:[username]/vesuvius-test.git
git push origin master
# You're done(ish)! Check GitHub and ask someone to do a local checkout and run all tests.
# NEXT STEPS:
# - When you're satisfied, rename the project from vesuvius-test to vesuvius.
# - Keep the LP branch around, but maybe freeze it and update the description to point to GitHub.
# - Add official team members at https://github.com/[username]/vesuvius/settings/collaboration .
# - Make sure the email address they used on LP is also verified on their GH account.
# - Ask Fran to make and populate an official vesuvuis GH team: https://github.com/orgs/sahana/teams
# - Coordinate transferring repo ownership to Sahana: https://github.com/[username]/vesuvius/settings
# - At some point you may want to migrate all the LP issues and blueprints into GitHub issues.
# - Consider migrating or disabling the wiki, if that's what is wanted.
# - Investigate writing a webhook for Pootle stuff: https://help.github.com/articles/post-receive-hooks
# - Other stuff I haven't thought of ...
@usmonster
Copy link
Author

One possible issue to note is that not all commits are associated with an email address:
git shortlog -es|sort -rn |grep -Ev "@.+\."
yields

   346  Isuru Samaraweera <>
   259  jayasinghe <>
   253  mahesh <>
   212  pradeeper <>
   199  Sudheera Fernando <>
   179  Ishan Liyanage <>
   170  Janaka S B Wickramasinghe <>
    84  Launchpad Translations on behalf of triune <>
    76  Saumya Gunawardana <>
    64  Anuradha Ratnaweera <>
    63  prabath <>
    56  ajithranabahu <>
    29  Buddhika <>
    28  hemapani <>
    28  deepal <>
    21  Chathra Hendahewa <>
    18  chinthaka <>
    17  nithyakala <>
    17  jaliya <>
    16  Trishan de Lanerolle <>
    13  damitha23 <>
    13  Akila <Akila@Akila-PC>
    12  chathura <>
     8  viraj <>
     8  Prabhath <>
     7  farhaanmohideen <>
     6  chamath <>
     5  Sanjiva Weerawarana <>
     5  gmiernicki <gmiernicki@ceb-greg-kubuntu>
     5  dims <>
     5  chintana <>
     4  Thushari Silva <>
     2  root <>
     2  jabhay <>
     2  Greg Miernicki <g@miernicki>
     2  g <g@tank>
     2  George Chatzisofroniou <sophron@otacon>
     2  cvs2svn <>
     2  Ben Hyde <>
     2  Ajay Kumar <>
     1  gmiernicki <gmiernicki@ceb-greg-lx>

There are ways to rewrite commit authors' email addresses in the git history (by careful use of git filter-branch), but it should be done before the official repo is ever pushed to or made public, if it is done at all. It might be important to make sure that all contributors have signed the CLA and that their commits are correctly associated with their email addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment