git_remote_branch 0.3 – Awesomeness for the masses
Awesomeness for the masses
git_remote_branch 0.3 has been released!
Previous releases were pretty much only usable by rubyists on OS X.
No more. This release is mostly focused on making sure git_remote_branch works on a broader range of platforms. A few actual features squeaked in, but nothing big like introducing new commands.
If you don’t care about the details just type the following at your command-line.
sudo gem install git_remote_branch
And check the help
grb --help
If you encounter installation problems, refer to the readme.
Platforms
git_remote_branch 0.3 has been tested with the following configurations:
- OS X Leopard / Ruby 1.8.6 / Git 1.5.4.3 and 1.6.0.2
- OS X Leopard / Ruby 1.9.1 / Git 1.5.4.3 and 1.6.0.2
- Ubuntu Intrepid Ibex / Ruby 1.8.7 / Git 1.5.6.3
- Windows XP / Ruby 1.8.6 / Git 1.6.0.2 (the msys version)
Features
Better track
Track now works even if you already have a local branch of the same name. It uses git config instead of branch —track in that case. The subtlety can be observed by running (from a git repository):
grb explain track master
grb explain track non_existent_branch
Force the use of a specific git executable
Set the environment variable GRB_GIT to point to it and grb will use this one for all its operations.
Documentation
I’ve also worked quite a bit on the actual documentation. I used to be ashamed at the quality and availability of the documentation of git_remote_branch. At last I’ll be able to sleep at night :-)
git_remote_branch in a nutshell
I’ve rewritten the intro of the readme to be (hopefully) a bit clearer.
git_remote_branch is a simple command-line tool that makes it very easy to manipulate branches published in shared repositories.
It achieves this goal by sticking to a few principles:
- keep grb’s commands extremely regular (they all look alike)
- support aliases for commands
- print all commands it runs on your behalf in red, so you eventually learn them
Another nice thing about git_remote_branch is that it can simply explain a command (print out all the corresponding git commands) instead of running them on your behalf.
Note: git_remote_branch assumes that the local and
remote branches have the same name. Multiple remote
repositories (or origins) are supported.
Documentation availability
The main readme is now available on the main grb page on rubyforge.
Documentation quality
I’ve added clearer information on getting grb to run in different kinds of situation, due to helpful feedback from Axelson and Glenn Rempe.
I’ve also added some information for playing with the code for git_remote_branch (test dependencies and so on). See the end of the readme.
Finally, I’ve updated the links section quite a bit:
| Documentation | http://grb.rubyforge.org |
|---|---|
| News | http://programblings.com/category/git/git_remote_branch/ |
| Bug tracker | Lighthouse |
| Code | http://github.com/webmat/git_remote_branch |
| Mailing list | http://groups.google.com/group/git_remote_branch |
Dare
I dare you to find a platform on which git_remote_branch doesn’t work :-)
If you do, please send me feedback through GitHub or via email. I’m using gmail and, as usual, I go by the handle of webmat.
Last note: the git_remote_branch gem on GitHub
Excerpt from the readme:
Note that the only stable version of the gem you should trust is the one from Rubyforge. The GitHub gem is a development gem. The GitHub gem WILL be rebuilt with the same version number, and other horrible things like that. If you use the GitHub version of git_remote_branch, children will die!
You’ve been warned.
git_remote_branch 0.2.6 is out!
I’ve just released a new and improved version of git_remote_branch. Code named 0.2.6!
Ok, I admit. I haven’t really begun using code names.
I’m promoting the project from a pre-alpha to an alpha release. There’s still a lot to do, but the stability and “testedness” have improved greatly. Following are both sides of the maturity story.
The project is maturing
- grb got its first contributor, Caio Chassot
- I added a lot of tests, both unit and functional
- there might even be interesting stuff to see in there for those who need to test command-line tools
- the gem can now be installed directly from RubyForge
- git_remote_branch now has a Google Group
The project is still immature
- it swears a lot
- no rubyforge page, despite the project being on rubyforge (at rubyforge.org/projects/grb)
- no real documentation other than running grb help
- very little in code documentation. On the other hand the code is spectacularly clean and readable, so that’s completely unnecessary. Just kidding.
What’s new in 0.2.6?
Three new actual features
- the ‘rename’ command, contributed by Caio Chassot
- the ‘publish’ command
- the −−silent option to completely mute grb output as well as every git command run by grb on your behalf
And other stuff
- the grb bin file now works when symlinked (also thanks to Caio Chassot)
- lots of unit and functional tests
- bug fixes
- more flexibility for running grb outside of a git repository (e.g. for ‘explain’ or ‘help’)
- now officially under the MIT license
- refactored a bunch of rake tasks
Git the new version
To install the newest version of the gem, simply run
sudo gem install git_remote_branch
If you really want to be on the bleeding edge you can also get it on GitHub. Note however that in ‘bleeding edge’ the word ‘bleeding’ is still the most important one at that point.
git clone git://github.com/webmat/git_remote_branch.git cd git_remote_branch rake install
The ‘install’ task will run the tests before installing so you’ll need Shoulda, mocha, redgreen and ruby-debug for that approach.
Not familiar with git_remote_branch?
What it is
The basic idea for git_remote_branch is to trivialize the interaction with remote branches. The first goal is to make the commands for the simple situations easy.
The secondary goal, is to help you learn the commands by seeing them displayed in a beautiful shade of red each time you use grb, along with git’s output.
git_remote_branch lets you
- create local-remote branche pairs, and tracks the remote branch automatically (for automatic merges when you git pull)
- publish a local branch as a remote branch, very similar to create
- delete local-remote branch pairs
- track a remote-only branch
- rename a local-remote branch pair
- explain by simply spitting out the necessary commands to do any of the above
How to use it
explain
If you simply want to use grb as a cheatsheet (and run nothing on your behalf), you can use the explain command:
$ grb explain create
git_remote_branch version 0.2.6
List of operations to do to create a new remote branch and track it locally:
git push origin current_branch:refs/heads/branch_to_create
git fetch origin
git branch −−track branch_to_create origin/branch_to_create
git checkout branch_to_create
or
$ grb explain create my_branch my_origin
git_remote_branch version 0.2.6
List of operations to do to create a new remote branch and track it locally:
git push my_origin current_branch:refs/heads/my_branch
git fetch my_origin
git branch −−track my_branch my_origin/my_branch
git checkout my_branch
Notice that you can specify any normally expected parameter you’d normally include and ‘explain’ will use them in the list of commands it suggests.
Even better, if you’re in your repository, the current branch is going to be taken into account:
(master) $ grb explain create my_branch my_origin
git_remote_branch version 0.2.6
List of operations to do to create a new remote branch and track it locally:
git push my_origin master:refs/heads/my_branch
git fetch my_origin
git branch −−track my_branch my_origin/my_branch
git checkout my_branch
Of course, ‘explain’ works for all commands: create, publish, delete, track and rename.
The main commands
I’m not going to painstakingly give an example for each command. I’ll only give two, to show how git’s responses are displayed when running grb without ‘explain’:
(master)$ grb create test_branch git_remote_branch version 0.2.6 git push origin master:refs/heads/test_branch Total 0 (delta 0), reused 0 (delta 0) To git@github.com:webmat/git_remote_branch.git * [new branch] master -> test_branch git fetch origin git branch −−track test_branch origin/test_branch git checkout test_branch Switched to branch "test_branch" (test_branch)$ grb delete test_branch git_remote_branch version 0.2.6 git push origin :refs/heads/test_branch To git@github.com:webmat/git_remote_branch.git - [deleted] test_branch git checkout master Switched to branch "master" git branch -d test_branch (master) $
Yes my friends, I have just boldly used grb on my real repository for your viewing pleasure.
But worry not, no repository was hurt during the writing of this article.
Feedback
For any feedback you’re of course welcome to
- comment on this article
- post in the google group
Thanks
- To Caio Chassot for the code contribution
- To the Thin team for a good inspiration on how to help manage gem creation and deployment with rake;
- Feedback from James Golick in day to day collaboration as well as all the people that commented on the initial announcement of git_remote_branch;
- To Chris Wanstrath (defunkt) from the GitHub team for pimping of the initial announcement of grb on the GitHub blog.
As seen on the Rails blog, sitepoint.com is giving away free PDF copies of Patrick Lenz’s book, Build Your Own RoR Web Apps. The offer is good for 60 days. Well, 59d15h at the time of posting :-)
It involves jumping through a couple of hoops, and the book contains a couple of pages containing ads about other Sitepoint books. But nothing too bad, at first sight. And it’s still a free PDF book! So if you know anybody who’s curious about Rails and might want to try it out, you have until the beginning of December to point him/her to rails.sitepoint.com.
Tonight is Montreal on Rails #3! I can’t wait to attend: this will be a nice refreshment from my gruesome C++ tar pit at work, ugh! :-)
The first 2 were very interesting and filled with great people to meet. Tonight promises to be just as great, and as a bonus, we’re leaving behind the small McGill University classroom to be welcome instead by Fred and Ben from Standoutjobs. Can’t wait to see that either!
And great big thanks to Mat and Carl for organizing this monthly meetup!
Podcasts I listen to
Here’s the deal. I have to beat writer’s block. I wrote a first post a while ago, then came the time for a little vacation and haven’t gotten down to write here again. Well, except for this quickie.
I thought I’d write a list of the podcasts I listen to. This way I can just point people here when they’re curious. I’ll put this somewhere else soon, to update it when I discover new stuff, but now I’m just in brain-dump mode :-)
Those I listen to religiously
- The Linux Action Show! – Bryan and Chris entertain us with Linux news, the occasional interview, tips on development, system administration, desktop compositing, and So Much More!
- .Net Rocks – Carl and Richard meet the cream of the crop in the .Net world. Great podcast to learn about tons of tools and practices related to .Net development and other MS technologies surrounding it. There’s even good stuff for non .Net developers.
- Hanselminutes – Scott Hanselman’s the ultimate geek. He seems to follow everything in the world of development. He often talks about .Net development, but has a very open mind and covers a broad range of other technologies, including a bit of Ruby on Rails once in a while. He also covers lots of other technology-related topics. He pretty much always manages to keep the podcasts around a no-fuss 30 minutes, hence the name Hanselminutes.
- Security Now – The ultimate security podcast, with host Leo Laporte and security expert Steve Gibson. All episodes are worth going back to, since the formula is about the theory behind concepts of security as well as security tools, rather than being a news-centric podcast.
- Macbreak Weekly – Definitely a news-centric podcast, very entertaining crew that transmit their passion for the Mac (and the iPhone) very well. The discussion often revolves around digital media as well, with very interesting insights. Oh, and Merlin Mann is often one of the cohosts. Very funny guy :-)
- The Ruby on Rails podcast – The podcast extraordinaire if you’re interested in Ruby on Rails. Interviews with the big names in the Rails community. Lots of talk about different tools that can aid you in your quest to create the ultimate Rails app. The summer has unfortunately brought few new shows, but one came out recently. Let’s hope the pace picks up again, I miss the RoR podcast :-)
- FLOSS Weekly – Very promising podcast about Free, Libre and Open Source Software (not about dental floss). Some very big names have been interviewed on the show (Guido van Rossum, “Maddog” Hall, Jeremy Allison, Randall Schwartz…) The first host, Chris, has a very busy schedule and the pace has really slowed down for a while. But there has been interest by Mr Shwartz and Allison to host the show once in a while as well. I can’t wait to see that happen (the most recent show is hosted by Schwartz, actually).
- You Suck at Web Design – Short, funny podcast by Matthew D. Jordan about being a freelance web designer (and the journey to get there). Twisted humor and cringe-inducing stories await you here.
Those I listen to occasionally
- net@night – Ambermac, the ultimate web geek speaks with Leo about what’s going on the internet. Interviews with web entrepreneurs. Shows recorded live on talkshoe.com (can be good or not).
- Windows Weekly – Paul Thurrot speaks with Leo about what’s going on in the world of Windows and Microsoft in general. The subject may seem dry, but the hosts definitely make up for it. A plus for anyone working in IT with lots of Windows machines. Thurrot knows the Windows world inside out, but is very balanced: he uses (and loves) his Mac and uses Ubuntu as well, so you can count on his opinion to always be fair.
- This Week in Tech – News-centric podcast about the world of technology in general. Very interesting hosts, including once in a while Merlin Mann, as well as John Dvorak.org/blog (don’t ask :).
- Penny Arcade Podcast – Every once in a while, Gabe and Tycho take us through the creative process of creating the day’s comic strip.
</braindump>
Huh, well! I appear to be beating my writer’s block little by little :-)
Let me know if you’ve discovered something interesting here or if you’d like to share the podcasts you listen too once in a while.
