GithubHelp home page GithubHelp logo

niemeyer / git-bzr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from termie/git-bzr-ng

2.0 3.0 0.0 576 KB

bi-directional git to bzr bridge: never fear bzr again

License: BSD 3-Clause "New" or "Revised" License

Shell 22.44% Python 77.56%

git-bzr's Introduction

Git-Bzr-NG or How I Learned to Stop Worrying and Love the Code

git-bzr-ng is a bidirectional bridge between git and bzr that lets you stop worrying which version control the code you love is using -- as long as they are using git or bzr ;) (hg coming soon?).

Easy to use and cleanly written (I hope (send patches!)). Check out the examples below for basic usage.

Example usage

Clone a launchpad repo

$ git bzr clone lp:nova nova

$ cd nova
$ git branch -a

# result ->
#   bzr/master
# * master

Make a new branch

$ git checkout -b touch_branch

$ echo "TOUCH" >> README
$ git commit -a -m "touch touch"
$ git bzr push lp:~termie/nova/touch_branch

Now you've got a cool new branch up on a server!
Go ahead and do some more work and push again.
It will go to the same place, and much faster now.

$ echo "TOUCH" >> README
$ git commit -a -m "touch touch"
$ git bzr push

How is trunk doing?
Sync is a slow operation the first time, like push.
They both speed up after they've done it once for a given branch.

$ git checkout master
$ git bzr sync
$ git diff bzr/master

Somebody else has a patch and you want to test it locally.

$ git bzr import lp:~vishvananda/nova/fix-part fix-part
$ git diff touch_branch

Like those changes? Pull them into your own branch and push them
$ git checkout touch_branch
$ git pull . -- fix-part
$ git bzr push

See test.sh for even more examples. Please try it out and report any issues to the github tracker at http://github.com/termie/git-bzr-ng/issues so we can sort them out quickly.

Extra Notes

I've tried to keep you from doing anything too weird, but since it is git I am sure you can figure out someway to mess stuff up, so if you somehow manage to push weird data to your bzr/* branches, you can always force an overwrite with:

$ git bzr sync --overwrite bzr/nova

It won't do anything to any branch except the one mentioned and on that one it effectively does a bzr pull --overwrite.

Requirements

  • git (some recentish version)
  • bzr 2.2 (pip install bzr==2.2)
  • bzr-fastimport (bzr branch lp:bzr-fastimport)
  • python-fastimport, for bzr-fastimport (bzr branch lp:python-fastimport)
  • You also need to put the git-bzr script somewhere in your path

Troubleshooting

If you see

AttributeError: 'BTreeBuilder' object has no attribute '_find_ancestors'

it means you have the bzr 2.3 beta installed, git-bzr-ng currently only works unpatched with bzr 2.2. It is possible to patch bzr 2.3 to correct the issue, but 2.2 is easy to install with pip.

Additionally there is a command git bzr clear that will wipe out the bzr-related information for a given branch so if you have somehow found yourself in a bind, it should help you wipe the slate to try again.

For other issues, please see: http://github.com/termie/git-bzr-ng/issues

Kind thanks to

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.