tl;dr -- Q: launchpad or github? A: #disapprovingasianfather: Why not
both?

I've been testing git-bzr-ng, a plugin for git that provides two-way
syncing between a git repo and launchpad.  Initial results are
promising, and I think I'm going to set up a github tree soon for wider
testing.  I think a simple cron script could be used to keep branches in
github synced with branches in launchpad.

For those playing along at home, my process is:

1. create empty git repo:   git init my-git-tree && cd my-git-tree
2. clone a launchpad tree:  git bzr clone lp:mixxx mixxx-trunk && cd
mixxx-trunk

This is slow because it checks out the whole bzr history and then
replays it into git.  However it only has to be done once per bzr tree
and I can clone the mixxx tree in under ten minutes.  Subsequent
pulls/pushes are much faster of course.

branches now look like this:
git branch -a
  bzr/master
* master

in which "master" is a clone of lp:mixxx, and bzr/master is a magical
entity which I've found isn't really meant to be used directly.  It's
sort of the halfway house that git-bzr-ng uses to get back to bzr.
Short answer:  there's no need to touch bzr/master, but don't remove it
either.

3. pull in updates from bzr:  git bzr pull
4. make edits in git:         nano whatever.cpp
5. commit the changes in git: git commit -a
6. push the changes to lp:    git bzr push

Note that on Ubuntu 12.10, I get an python error here from
bzr-fastimport.  This small patch fixes it (I just edited
revision_store.py by hand):
http://bazaar.launchpad.net/~agrimm/bzr-fastimport/baseline-commit/revision/342

7. Now create a repo on github with the web UI.
8. Tell git about the remote:  
           git remote add origin g...@github.com:ywwg/lp-test.git
9. Tell git to have the current branch track that remote as upstream:
           git branch -u remotes/origin/master
10. Pull from github to get the README and .gitignore it may have
created:
           git pull
11. Push to github.  This will take a while to upload the whole revision
history:   git push

So now you can sync from lp to git:
git bzr pull && git push
And sync from git to lp:
git pull && git bzr push

NOTE: If you're trying this and do a git bzr push right now, you'll push
in the .gitignore and README file that github created.  Try going git
diff bzr/master and you'll see.

I believe this is cronable, although I have to confirm that the commands
don't ask for user input.  What happens when someone edits both
launchpad and git in between syncs?  I have no idea.  There could be
conflicts that would have to be manually resolved, I suspect.

Have a look at https://github.com/ywwg/lp-test to see what I pushed.
Notice the commit log is intact, and even gitk shows all of the
branching / merging!  (https://github.com/ywwg/lp-test/commits/master).
And somehow github knows about RJ too!

TODO:  See if I can also check out branches like mixxx/1.11 and see if
github understands how those relate.


Owen




------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to