Help with Bzr-Git

John Arbash Meinel john at arbash-meinel.com
Wed Jul 14 17:23:19 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Carrera wrote:
> Excellent, it works now. PPAs are cool.
> 
> Can I ask a couple of questions about Bazaar?:
> 
> 1) Does "bzr push" automatically push all branches to the server (as
> in Mercurial) or do you have to do something special to push a branch?
> 
> 2) How can you use the "shelve" command to put aside a specific hunk
> in a file? For example:
> 
> # Add a file.
> echo "Line 1\nLine 2\nLine 3\nLine 4" > file
> bzr add file
> bzr commit -m 'Initial commit'
> 
> # Change two lines.
> echo "Hello\nLine 2\nLine 3\nWorld" > file
> bzr shelve
> 
>

It would, but your context lines aren't quite enough. Specifically,
Unified diff defaults to (IIRC) 3 lines of context. Add another "Line
4\nLine 5" and I think the hunks will be separate. Alternatively, try it
with a more realistic change.

If you set "change_editor = ???" in ~/.bazaar.conf and it will let you
press "e" to edit the changes that are displayed. Which lets you create
a smaller diff hunk.

For example, on Windows I have:
change_editor = "C:/Program Files/Vim/vim72/gvim.exe -d"

Which brings up gvim's side-by-side diff mode, which makes it pretty
easy to set up what content you want to keep, and everything else will
get shelved.

I will say it wasn't as discoverable as I expected.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw95HYACgkQJdeBCYSNAAN4RACg1HOmTCeK5LskzLMVbOpFccqK
UOkAnRTZ2dLPve2akMsn2lUX/AFQnzpw
=1lnQ
-----END PGP SIGNATURE-----



More information about the bazaar mailing list