Gogs is a self-hosted Git service written in Go #

Gogs looks like a nice, new (still in Alpha) option if you want to self-host some Git repositories with a web interface similar to GitHub’s.

Gogs

It’s written purely in Go, so installation should be dead simple. From the README:

Gogs only needs one binary to setup your own project hosting on the fly!

Worth a look.

Build beautiful programming books with Git and Markdown #

There’s a lot of innovation (and iteration) going on in the online publishing space. GitBook continues that trend by offering a command line tool built specifically for creating programming book and exercises.

You write your book in Markdown and from that GitBook can generate a static website, PDF, eBook, and even JSON. Here’s what the results look like:

GitBook Preview

An interactive shell for Git #

The only problem I see with gitsh is reversing years of Git muscle memory with git appended to each command.

Git commands tend to come in groups. Avoid typing git over and over and over by running them in a dedicated git shell.

Avoiding typing git over and over isn’t the only reason you should check out this project by thoughtbot — check out the answers to Why should you use gitsh? in the readme.

Facebook, Mercurial or Git? #

They chose Mercurial.

Our engineers were comfortable with Git and we preferred to stay with a familiar tool, so we took a long, hard look at improving it to work at scale. After much deliberation, we concluded that Git’s internals would be difficult to work with for an ambitious scaling project.

Instead, we chose to improve Mercurial.

Internal open source projects like hgwatchman and remotefilelog help them to achieve performance gains from status, clone and pull operations.

Together, the hgwatchman and remotefilelog extensions have improved source control performance for our developers, allowing them to spend more time getting stuff done instead of waiting for their tools.

How many other organizations with large codebases will follow Facebook to drink the Mercurial water too? Facebook’s move to Mercurial should come as good news for Bitbucket as well.

Mercurial or Git? Tell us on Twitter.

Git your game on with Githug! #

Githug is a cool new way to learn git by Gary Rennie. From the readme:

Githug is designed to give you a practical way of learning git. It has a series of levels, each utilizing git commands to ensure a correct answer.

Game on!

#103: GitLab and open source with Sytse Sijbrandij

Andrew and Adam talk with Sytse Sijbrandij, one of the Co-founders of GitLab, about building GitLab, sustaining open source, community management, and ways to handle a “road map” for your product or project.

GitPrep, the open source GitHub clone #

If you want to run a GitHub-like system in-house, GitPrep by Yuki Kimoto is worth a look.

The project home page includes a
screenshot, but you can also visit a project hosted on a
public facing installation
and can click around.
There are nice diff pages and you can also get a
blame report.

The project is still very young, but looks promising.

GitPrep is written in Perl and it is very easy to install, even on a shared host. It can run
its own web server, use any web server supporting PSGI/Plack, and it can
even run in CGI mode for those shared hosts.

GitPrep is built using the Mojolicius web framework and
Twitter Bootstrap. Its source code is on GitHub
and it is licensed under the Artistic license.

Deploy apps to your own mini-Heroku with Dokku #

dotCloud’s Docker — a project which makes managing Linux containers easy, previously covered here and discussed on episode #89 — is inspiring & enabling a bunch of open source Platforms as a Service (PaaS).

One of the first (and definitely the smallest) of these is Dokku by Jeff Lindsay.

Dokku weighs in at under 1,000 lines of Bash and offers the same git-push-based app deployment made famous by Heroku and emulated by many PaaS providers. After installation and some configuration, you can deploy to your own mini-Heroku using one of the many supported buildpacks.

Here’s what deploying Heroku’s example Node.js app looks like with Dokku:

$ cd node-js-sample
$ git remote add progrium git@progriumapp.com:node-js-app
$ git push progrium master
Counting objects: 296, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (254/254), done.
Writing objects: 100% (296/296), 193.59 KiB, done.
Total 296 (delta 25), reused 276 (delta 13)
remote: -----> Building node-js-app ...
remote:        Node.js app detected
remote: -----> Resolving engine versions

... blah blah blah ...

remote: -----> Application deployed:
remote:        http://node-js-app.progriumapp.com

It’s exciting to see how much can be done with so little code. Dokku is MIT licensed and hosted on GitHub.

JS Git Kickstarter met its funding goal and is now funding stretch goals! #

If you haven’t seen the JS Git Kickstarter from retired Changelogger Tim Caswell and you’re excited about having Git in JavaScript you should check it out — maybe even back it. The project has already met its funding goal and is now funding its stretch goals.

From the Kickstarter story:

The main use case this enables is developing offline in environments like ChromeBooks. I worked on Cloud9IDE for a year and it was a great experience as long as you were online with a fast connection. With this library, HTML5 apps will finally be able to do the full developer lifecycle. They can clone from github to the browser’s local file storage when online, work offline using an editor like ACE or CodeMirror, and then when they are online again, they can push their changes back to github. I’ll implement branching, merging, diffing, and as many other awesome common tasks from git as possible.

Tim’s plan is to develop the library in the open and license it under the MIT license. “It will be open sourced on GitHub as soon as the Kickstarter succeeds,” says Tim. Our guess is you’ll be able to fork it here github.com/creationix/js-git on Saturday Mar 30, 11:50am CDT when the Kickstarter funds.

Check out JS Git on Kickstarter and back it if you’re excited about having Git in JavaScript!

Git 1.8.2 released #

I’m pretty sure that most of you who read The Changelog care about git. Well, yesterday, 1.8.2 was released!

Of course, linking to the commit that actually did the release isn’t mega-helpful, so here’s a link to the CHANGELOG instead.

My favorite change is this one:

The patterns in .gitignore and .gitattributes files can have **/,
as a pattern that matches 0 or more levels of subdirectory.
E.g. foo/**/bar matches bar in foo itself or in a
subdirectory of foo.

I find myself wanting this a bunch, so it’s nice to have in. I’m also pumped about ‘git check-ignore’, which helps you figure out if what you added to your .gitignore actually did what it’s supposed to do.


Discuss on Hacker News

On GitHub and Workflows #

One of the best things about git is that it allows you to do whatever you want.

One of the worst things about git is that it allows you to do whatever you want.

This has lead to a bunch of different ‘workflows’ for managing an open source project. I remember when “Git Flow” hit the scene, and everyone was mega-excited by it. Then, GitHub themselves fired back with “GitHub flow,” which was a bit simpler and talked about how they handle things.

Here’s Yet Another Entry into this ongoing saga: “On GitHub and Workflows” Basically, it’s somewhere in between the two: you have three branches, representing production, staging, and development. On top of development, you work like GitHub Flow, and when things go from development -> staging and staging -> production, there’s an opportunity for a last code review.

As a bonus, there’s a little script at the bottom for making pull requests from the command-line with hub. Neat! We originally saw this from this tweet by @moo9000.

Divergence turns subdomains into remote branches #

Switch branches as fast as you switch pages. Waiting for a deploy sucks. Allocating a staging server for each remote branch is costly. But nothing beats testing on a staging server with real production data. Divergence allows you to quickly test your remote branches simply by changing the subdomain.

If you’ve ever had the need for a second staging server for an early release of a feature that’s not ready to merge to master, Divergence from LayerVault could be what you’ve been waiting for.

Divergence sub-domain example

With Divergence you can easily view any branch from your repository on your staging server by using the branch name as the subdomain. Just use your branch name as the sub-domain and Divergence will magically find your branch and serve it up. You can even hook into a number of callbacks to automatically restart Passenger, run bundle install, or any other task if needed.

It’s a Rack application that acts as a HTTP proxy between you and your web application for rapid testing. Divergence was built with an Apache-Passenger stack in mind, so if you’re wanting to help develop the project further, checkout the contributing section of the readme.

Divergence is a work in progress, and labeled as a beta release. The folks at LayerVault could use a hand with:

  • Increased language support
  • More stacks supported, (e.g. nginx, Unicorn, etc.)
  • HTTPS support built-in

Sample config from the readme:

Divergence::Application.configure do |config|
  config.git_path = "/path/to/git_root"
  config.app_path = "/path/to/app_root"
  config.cache_path = "/path/to/cache_root"

  config.forward_host = 'localhost'
  config.forward_port = 80

  config.callbacks :after_swap do
    restart_passenger
  end

  config.callbacks :after_cache, :after_webhook do
    bundle_install :path => "vendor/bundle"
  end

  config.callbacks :on_branch_discover do |subdomain|
    case subdomain
    when "release-1"
      "test_branch"
    when "release-2"
      "other_branch"
    end
  end
end

Checkout the repo and readme for detailed instructions on installation and setup. If you’d like to see more stacks supported beyond an Apache-Passenger stack, fork it and help out.

Barkeep – the Friendly Code Review System #

Barkeep

Some of the engineers from Ooyala have released a new project that “makes code reviews fun.” It is a standalone piece of software that you host on your own (they recommend using Vagrant/VirtualBox).

With barkeep you get syntax-highlighted colored diffs, the ability to easily add your own features, a simple CLI, a REST API and plaintext (threadable) emails. Out of the box, barkeep offers many more features that will keep code reviews quick and entertaining. You can use barkeep with any git repo that has a reachable URL.

The team at Ooyala plans on growing barkeep as the community sees fit. Open issues as you play around with it – better yet, fork it and add new features yourself! Their style guidelines are simple: “mimic the style around you.”

You can view a live example, get some more information or browse the source at GitHub.

gitignore-boilerplates – Shell script for cloning GitHub .gitignore templates #

GitHub’s .gitignore templates are awesome, but mashing them up into a new project can be a pain. Simon Whitaker has created a handy shell script to make that easier:

gibo Python vim >> .gitignore

This will copy the contents of GitHub’s Python and vim templates to your .gitignore. Brilliant.

The script also lets you list all the templates in the GitHub project:

gibo -l

Check out the source on GitHub to check out implementation, usage, or how to contribute.

Update: Lucas let us know about gemignore, his Ruby gem for the same task.

Githug – level up your Git chops #

We’ve blogged about Git gamification before. Now, Gary Rennie has released Githug which challenges players to complete levels and learn Git features at the same time. Levels are created using a Ruby-based DSL:

difficulty 1
description "There is a file in your folder called README, you should add it to your staging area"

setup do
  repo.init
  FileUtils.touch("README")
end

solution do
  return false unless repo.status.files.keys.include?("README")
  return false if repo.status.files["README"].untracked
  true
end

hint do
  puts "You can type `git` in your shell to get a list of available git commands"
end

Got an idea for a Githug level? Submit a patch.

gitfinger – finger GitHub users from the command line #

First there was finger. Then there was web finger. Now Daniel Choi brings you gitfinger. Just install the gem and you can get a project summary for any GitHub user:

$ gitfinger pengwynn

                     repo     w    f   i      updated       pushed     type  desc                                                                                                                      
                  octokit   153   43   6  Jan 25 2012  Jan 21 2012   source  Simple Ruby wrapper for the GitHub v2, v3 API and feeds                                                                   
       faraday_middleware    80   17   0  Jan 24 2012  Jan 24 2012   source  Various Faraday middlewares for my Faraday-based API wrappers                                                             
                   fumblr    56   11   4  Jan 24 2012  Dec 14 2011   source  Stop fumbling with your Tumblr theme development - mashup of my own process with Thimblr                                  
                 dotfiles     3    1   0  Jan 24 2012  Jan 24 2012   source  My public dotfiles                                                                                                        
                 linkedin   384  171  31  Jan 24 2012  Jan 17 2012   source  Ruby wrapper for the LinkedIn API                                                                                         
        compass_formalize    76    6   1  Jan 23 2012  Nov 15 2011   source  Compass and Sass port of Nathan Smith's Formalize project                                                                 
          ujs_sort_helper    14    9   1  Jan 22 2012  Oct 14 2011   source  Unobtrusive sort helper for Rails                                                                                         
                  groupon    17    9   1  Jan 22 2012  Jan 11 2012   source  Ruby wrapper for the Groupon API                                                                                          
               guard-sass     3    0   0  Jan 20 2012  Apr 26 2011     fork  Guard::Sass automatically rebuilds sass files when modified (like sass --watch)                                           
      javascript-patterns     1    0   0  Jan 16 2012  Jan 16 2012     fork  JavaScript Patterns                                                                                                       
                    topsy    25    6   1  Jan 15 2012  Jan 05 2012   source  Ruby wrapper for the Topsy.com Otter API                                                                                  
        compass-wordpress    67   15   3  Jan 15 2012  Jan 08 2012   source  Compass plugin for creating WordPress themes using Sass                                                                   
        transparency-data    14    5   0  Jan 12 2012  Jan 07 2011   source  Wrapper for the Sunlight Transparency Data API                                                                            
                   presto    29    4   0  Jan 07 2012  Jun 14 2010   source  Padrino + NestaCMS                                                                                                        
                oh-my-zsh     5    2   0  Jan 05 2012  Nov 25 2011     fork  A community-driven framework for managing your zsh configuration. Includes optional plugins for various tools (rails, g...
                 chargify    67   22   1  Jan 01 2012  May 21 2011   source  Ruby wrapper for the chargify.com SAAS and billing API                                                                    
                  gowalla    66   21   2  Dec 28 2011  Nov 02 2011   source  Ruby wrapper for the Gowalla API.                                                                                         
compass-twitter-bootstrap     1    0   0  Nov 30 2011  Nov 30 2011     fork  The twitter bootstrap ported to compass                                                                                   
                       pt     1    0   0  Nov 23 2011  Nov 23 2011     fork  Minimal client to use Pivotal Tracker from the console.                                                                   
   nesta-plugin-sluggable     5    3   0  Nov 19 2011  Sep 25 2011   source  Sluggable posts for Nesta CMS                                                                                             
    nesta-plugin-linkable     2    2   0  Nov 19 2011  Sep 25 2011   source  Easy link posts for Nesta CMS                                                                                             
               tmuxinator     1    0   0  Nov 11 2011  Nov 11 2011     fork  Manage complex tmux sessions easily                                                                                       
                  thimblr     1    1   0  Nov 05 2011  Nov 05 2011     fork  Thimblr (a rewrite of mwunch's excellent Thimble) is stand alone Ruby app that will help you in designing your Tumblr t...
                   zocial     2    0   0  Oct 27 2011  Sep 25 2011     fork  Zocial CSS3 button set and vector icons with @font-face as a Sass mixin and usable as a Compass extension                 
nesta-plugin-project-meta     3    2   0  Oct 12 2011  Oct 12 2011   source  Plugin for Nesta CMS to show Github, Rubygems data for projects                                                           
               buzzsprout     4    1   0  Oct 10 2011  Oct 10 2011   source  Ruby wrapper for the ghost Buzzsprout API                                                                                 
               thor-tasks     6    1   0  Oct 08 2011  May 06 2011   source  Utility thor scripts                                                                                                      
             nestacms.com     1    0   0  Oct 04 2011  Sep 25 2011     fork  The web site for Nesta CMS                                                                                                
           ti-vim-snippet     1    0   0  Oct 04 2011  Jun 22 2011     fork  `ti` snippets for writing `coffescript` and `sass`                                                                        
                  compass     1    0   0  Oct 04 2011  Aug 12 2011     fork  Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain. 
               underscore     1    0   0  Oct 04 2011  May 31 2011     fork  JavaScript's utility _ belt                                                                                               
                   powder     4    2   0  Oct 04 2011  Apr 09 2011     fork  Syntactic suger for http://pow.cx/                                                                                        
                    geera     2    0   0  Oct 04 2011  Mar 30 2011     fork  A commandline client for JIRA                                                                                             
          textmate-themes     3    1   0  Oct 04 2011  Jan 14 2011   source  My TextMate themes                                                                                                        
                    nesta     1    0   0  Oct 04 2011  Aug 27 2011     fork  A lightweight CMS, implemented in Sinatra.                                                                                
                  faraday     2    0   0  Oct 04 2011  Oct 12 2010     fork  experiments in a rest api lib                                                                                             
                     mush     2    1   0  Oct 04 2011  Aug 27 2010     fork  A Multi-service URL Shortener gem with command-line utility (bit.ly, is.gd and u.nu supported)                            
       wynnnetherland.com     1    1   0  Oct 04 2011  Jan 06 2011   source  My personal web site powered by Presto                                                                                    
                   oauth2     1    1   0  Oct 04 2011  Jun 28 2010     fork  A Ruby wrapper for the OAuth 2.0 protocol.                                                                                
                formstack     7    2   0  Oct 04 2011  May 23 2010   source  Ruby wrapper for the Formstack API                                                                                        
                  twitter     2    1   0  Oct 04 2011  Mar 30 2010     fork  API wrapper for Twitter and Twitter Search API's                                                                          
                   tumblr     4    1   0  Oct 04 2011  Aug 07 2010     fork  Ruby library and command line utility for Tumblr                                                                          
                 plancast    12    1   0  Oct 04 2011  Jun 16 2010   source  Wrapper for the unpublished Plancast API                                                                                  
                    weary     3    1   0  Oct 04 2011  Mar 31 2010     fork  A little DSL for consuming RESTful web services.                                                                          
              twitterland    10    2   0  Oct 04 2011  Apr 05 2010     fork  Ruby wrapper for various Twitter-related APIs                                                                             
                    giact     2    1   0  Oct 04 2011  Apr 01 2010   source  Ruby wrapper for the Giact POST API                                                                                       
         chunky-baconfile    14    1   0  Oct 04 2011  Jan 07 2010   source  Tasty wrapper for the Baconfile API                                                                                       
           authentic_jobs     3    2   0  Oct 04 2011  Jun 12 2010   source  Find your next gig from the console. Ruby wrapper for the Authentic Jobs API                                              
        backtweets_helper     5    1   0  Oct 04 2011  Dec 02 2009   source  Rails helper for Backtweets widgets                                                                                       
                 nextstop     4    1   0  Oct 04 2011  Nov 18 2009   source  Ruby wrapper for the Nextstop.com API                                                                                     
               readernaut     4    3   0  Oct 04 2011  Nov 18 2009   source  Ruby wrapper for the Readernaut social reading site API

Rails gets automatic EXPLAIN logging for slow SQL queries #

In a fresh commit, Rails edge now has the ability to automatically add query plan info to the standard Rails logger:

# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5

… which will yield something like:

+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+
| id | select_type | table | type  | possible_keys | key     | key_len | ref   | rows | Extra       |
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+
|  1 | SIMPLE      | users | const | PRIMARY       | PRIMARY | 4       | const |    1 |             |
|  1 | SIMPLE      | posts | ALL   | NULL          | NULL    | NULL    | NULL  |    1 | Using where |
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+
2 rows in set (0.00 sec)

Hot.

Search Git history easily with git-diff-grep #

Always on the lookout for Git timesavers, I’m a regular user of Vincent Driessen’s git-flow and TJ’s git-extras. The newest addition to my git toolbox is git-grep-diff from Oscar Del Ben. This simple bash script allows you to search your git diff history and look for a given search pattern:

git grep-diff <number_of_revisions_to_search> <query>

The search results output even supports terminal colors. I’d love to see a nice man page like those found in git-extras. If you would, too, why not fork the project and contribute?