Accept pull requests, the pretty way. Featured in http://rubyweekly.com/issues/180.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
.gitignore
.travis.yml
CHANGELOG.markdown
Gemfile
Guardfile
MIT-LICENSE
README.md
Rakefile
git_pretty_accept.gemspec

README.md

git-pretty-accept

Build Status

git-pretty-accept is a script that rebases a pull request before merging to master. Pull requests are always merged recursively. The result is a linear history with merge bubbles indicating pull requests. In short, pretty.

For more information, check out

git-pretty-accept also automatically deletes the local and remote branch of the pull request once it's merged to master.

Installation

Add this line to your application's Gemfile:

gem 'git_pretty_accept'

And then execute:

$ bundle

Or install it yourself as:

$ gem install git_pretty_accept

Usage

To accept a pull request, just run git pretty-accept BRANCH_NAME in the branch where BRANCH_NAME will be merged.

Merge commit template

You can also provide a merge commit template .git-pretty-accept-template.txt to your project directory. This is great if you want your merge commits to follow a certain format e.g. you want your team to enter the issue link when accepting pull requests.

Caveats

We wrote git_pretty_accept for our particular workflow. If you'd like to use the gem, here are a few things you'll need to keep in mind. The script

  1. Assumes that your remote repository is origin. It doesn't work yet with Github forks.
  2. Automatically removes the local and remote branch of the pull request once the pull request is merged.
  3. Complains if you accidentally try to accept the master branch to a feature branch.
  4. Rebases the local branch in interactive mode so that it can run autosquash(See --autosquash under http://git-scm.com/docs/git-rebase#_options).

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request