While at RubyConf this year, giving my talk and drinking like an idiot with nearly every internet-famous Rubyist out there, I had a great idea. Only my incredible humility prevents me from being able to properly describe the full awesomeness of this idea. While talking with some GitHub users there (which were many – there were tons of ‘Fork You’ sightings, and half the talks had a GitHub URL or Octocat in them at some point), I thought of a pretty useful addition to the github gem tool. So, I coded up a command line version of the network graph information, and it has since been pulled into the official github gem.
I also found out that not too many of the guys I talked to use the github gem, but of those that do, they seem to love it. So, yesterday I did a 20 minute screencast on how to use the github gem itself and our new network additions to it.
The long and the short of it is that the command line tool now has an interface to the network graph api – you can now view a list of all the remotes in your projects network that have commits that you haven’t pulled in yet, and you can list each of those commits and decide if you want to cherry-pick, merge or ignore them.
This gives everyone a nice, simple workflow to keep up to date on what patches people have pushed and be able to manage those changes easily. If you have a project or have forked a project that has a number of forks and want to see quickly and easily what is out there that you don’t have yet – this is going to change your life.
Even cooler, you can filter and sort the list of outstanding commits, including by whether or not each patch will apply cleanly to your current HEAD. You can literally have hundreds of patches pending from people and be able to see which of those hundred should cause you no merge conflicts when incorporating. That will let you contact the others and ask them to rebase their work off your current work before you will pull them in. For more details and examples, check out the screencast :
(you may want to fullscreen this to read all the command line stuff…)
On a side note, I tested this out in like 5 online video sites, and I have to say if you’re looking to put screencasts online where you need to be able to read fine text – blip.tv is basically your only choice. Seriously – that site rocks. If you click the fullscreen you can actually read everything, it’s not all pixelated and such. Youtube, Vimeo, Viddyou, Brightcove – nothing else worked. fyi…


Cool! Where can we get the screencast in a format more palatable than flash?
(Do you have to have flash installed to see the link?)
Off topic – I saw a HD video on Vimeo yesterday which looked great (demoing the Red + Redshift projects)
Vimeo can do HD, but it needs to be larger than a certain size which my recording was just short of. You can also only embed it a certain number of views, which Blip doesn’t seem to have. Normally I love Vimeo, but from now on I think I’m going to be using blip.
As for the screencast, if you go to the Blip site for the cast (http://blip.tv/file/1456353), you can download the original .mov file in the sidebar (lower on the right side of the screen, under ‘Files and Links’)
Looks neat, and thanks for making a screencast. Bug report: it doesn’t work on private projects, just throws an exception:
$ github network list /usr/lib/ruby/1.8/open-uri.rb:174:in `open_loop’: redirection forbidden: http://github.com/Harkins/[my private project]/network_meta → https://github.com/Harkins/[my private project]/network_meta (RuntimeError) from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri’ from /usr/lib/ruby/1.8/open-uri.rb:518:in `open’ from /usr/lib/ruby/1.8/open-uri.rb:30:in `open’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/../lib/github/command.rb:67:in `cache_data’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/../lib/github/command.rb:55:in `get_network_data’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/commands/commands.rb:42:in `command’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/../lib/github/command.rb:21:in `send’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/../lib/github/command.rb:21:in `call’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/../lib/github.rb:62:in `invoke’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/../lib/github.rb:56:in `activate’ from /home/harkins/.gems/gems/defunkt-github-0.2.1/bin/github:5 from /home/harkins/.gems/bin/github:19:in `load’ from /home/harkins/.gems/bin/github:19
Did you try Viddler at all? They’re pretty badass, usually.
Scott awesome new features, it looks great. There was a comment you made on the screen cast that I wanted to make sure it was clarified.
github pull mojomboDoes pull mojombo’s branch but only after it merges it with your current branch.
github fetch mojomboWill create a new local branch with mojombo’s master.
Again, great work.
I’m a little confused as to why you have to pass the “—ssh” option when you want to clone one of your own repos. Couldn’t the github gem just look at your github user in ~/.gitconfig and automatically use the read/write URL if you’re cloning your own repository?
Or should I just fork and add it myself? =)
I am in love with the new github-gem features. So sweet. I might go write a bash autocompletion suite for it.
we are accepting patches :)
I’ve already got some good feedback I’d like to work in – the binding between username/project and remote name is a little too strict, and the private repo should also be fixable, but the public projects tend to have the most forking going on, so I thought I’d put it out there. if anyone wants to tackle either of those, I’d love to pull the changes in.
Intrigued by your post, I decided to give it a try – installation went fine, but issuing the github command gives me a rather nasty error: /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — json (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’ from /Library/Ruby/Gems/1.8/gems/defunkt-github-0.2.1/bin/../lib/github.rb:7 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’ from /Library/Ruby/Gems/1.8/gems/defunkt-github-0.2.1/bin/github:3 from /usr/bin/github:19:in `load’ from /usr/bin/github:19
@drnic I started one a few months back, you can find it at http://gist.github.com/24132.
>I’ve installed it on Mac OSX, it has install defunkt-github-0.2.1.gem in /Library/Ruby/Gems/1.8/cache/.
How do you add the github command in the path?
Looks really nice and would be something to really help catch those stray commits floating around. I did find a bug, when using ‘github network commits’ on the Redmine repository it’s throwing out a invalid date error.
/usr/lib/ruby/1.8/date.rb:931:in `new_by_frags': invalid date (ArgumentError) from /usr/lib/ruby/1.8/date.rb:975:in `parse' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/commands/helpers.rb:104:in `print_commits' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/commands/helpers.rb:104:in `sort!' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/commands/helpers.rb:104:in `print_commits' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/commands/commands.rb:86:in `command' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/bin/../lib/github/command.rb:21:in `send' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/bin/../lib/github/command.rb:21:in `call' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/bin/../lib/github.rb:62:in `invoke' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/bin/../lib/github.rb:56:in `activate' from /var/lib/gems/1.8/gems/defunkt-github-0.2.1/bin/github:5 from /var/lib/gems/1.8/bin/github:19:in `load' from /var/lib/gems/1.8/bin/github:19I might try to dive in and see what is causing the bug (I know one forker renamed his repository and it already breaks the web network graph). I’d also like to add support for using the gem when github isn’t the origin (e.g. I use the “github” branch for GitHub and “origin” for my server).
i’m working on getting this to work on the rails repo – which is the most badass repo i can think of. it’s both pretty big and has a bajillion forks, so i’ve now run into a bunch of these – the next release of this should solve all of these issues (except possibly the private repo one, which I haven’t looked at yet). but i figure if you could manage the rails patch cloud with this, then it should work for just about anything…
Path working fine with today’s update, dont know where the change has been done :)
Thanks a lot for this gem and the great screencast!