• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create Git release commits and tags with changelogs

git bump

Here's a popular set of best practices for doing releases for code bases stored in Git:

  • Update version-related minutiae in the code base.
  • Commit with a message like projectname 1.2.3.
  • Create a signed, annotated tag with the same message with a name like v1.2.3.

I like these practices. They're the ones used by Git itself for its own source code. You might quibble over details (why is there a v at the beginning of the tag?), but I think this is a place consistency should outshine bikeshedding.

There's one more practice that I'd like to add:

  • Include release notes in the release commit.

This isn't always a good fit, but for smaller projects, I find this to be a great alternative to maintaining a formal document inside the repository. You can easily scrape the information out of the commits later if your needs change.

I made git bump to encapsulate these practices.

Installation

Assuming you want to install with your system's Ruby:

sudo gem install git-bump

Usage

The primary interface is git bump. Here's how you would use it for a new project.

Initial release

Stage the changes needed to create the release (this could be the entire repository if it's an initial commit), and run git bump <version>, where <version> is the version you want to release (try 1.0.0). You'll be greeted with a familiar sight:

spline-reticulator 1.0.0

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.

Adjust the project name if necessary, and save and quit the editor. Your commit and tag will be created, and you'll be shown instructions for pushing once you're sure everything is okay.

Second release

This is where the fun begins. Stage the changes necessary for release, and run one of the following commands:

  • git bump -- bump the rightmost number in the previous version.
  • git bump point -- bump the third number in the previous version, and reset everything afterwards to zero.
  • git bump minor -- bump the second number in the previous version, and reset everything afterwards to zero.
  • git bump major -- bump the first number in the previous version, and reset everything afterwards to zero.
  • git bump <version> -- bump to an exact version.

The commit message body will be pre-populated with a bulleted list of commit messages since the previous release. My practice is to heavily edit this into a higher level list of changes by discarding worthless messages like typo fixes and making related commits into a single bullet point. If you aren't interested in this practice, delete the body and git bump won't bother you with it again.

Subsequent releases

On subsequent releases, if no changes are staged, git bump will replay the previous release commit, replacing the appropriate version numbers. This works fine as long as your version numbers are committed as literal strings. If you're doing something more clever like MAJOR = 1 and MINOR = 2, you'll have to do the edit by hand and stage it.

Existing projects

You'll need to create one existing release commit and tag in the proper format by hand, if your project doesn't already have one. After that you can use git bump normally.

More Repositories

1

vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
Vim Script
19,851
star
2

vim-surround

surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease
Vim Script
13,347
star
3

vim-pathogen

pathogen.vim: manage your runtimepath
Vim Script
12,116
star
4

vim-commentary

commentary.vim: comment stuff out
Vim Script
5,849
star
5

vim-sensible

sensible.vim: Defaults everyone can agree on
Vim Script
5,111
star
6

vim-rails

rails.vim: Ruby on Rails power tools
Vim Script
4,096
star
7

vim-dadbod

dadbod.vim: Modern database interface for Vim
Vim Script
3,615
star
8

vim-unimpaired

unimpaired.vim: Pairs of handy bracket mappings
Vim Script
3,312
star
9

vim-abolish

abolish.vim: Work with several variants of a word at once
Vim Script
2,765
star
10

vim-dispatch

dispatch.vim: Asynchronous build and test dispatcher
Vim Script
2,637
star
11

vim-repeat

repeat.vim: enable repeating supported plugin maps with "."
Vim Script
2,597
star
12

vim-vinegar

vinegar.vim: Combine with netrw to create a delicious salad dressing
Vim Script
2,226
star
13

vim-sleuth

sleuth.vim: Heuristically set buffer options
Vim Script
1,874
star
14

vim-eunuch

eunuch.vim: Helpers for UNIX
Vim Script
1,812
star
15

vim-obsession

obsession.vim: continuously updated session files
Vim Script
1,746
star
16

vim-fireplace

fireplace.vim: Clojure REPL support
Vim Script
1,746
star
17

vim-markdown

Vim Markdown runtime files
Vim Script
1,223
star
18

vim-endwise

endwise.vim: Wisely add
Vim Script
1,112
star
19

vim-projectionist

projectionist.vim: Granular project configuration
Vim Script
1,048
star
20

vim-rhubarb

rhubarb.vim: GitHub extension for fugitive.vim
Vim Script
953
star
21

vim-speeddating

speeddating.vim: use CTRL-A/CTRL-X to increment dates, times, and more
Vim Script
949
star
22

timl

Clojure like language which compiles down to VimL
Vim Script
680
star
23

vim-scriptease

scriptease.vim: A Vim plugin for Vim plugins
Vim Script
674
star
24

dotfiles

tpope's dotfiles. DON'T USE unless you're tpope
Vim Script
622
star
25

vim-haml

Vim runtime files for Haml, Sass, and SCSS
Vim Script
593
star
26

vim-git

Vim Git runtime files
Vim Script
589
star
27

vim-rsi

rsi.vim: Readline style insertion
Vim Script
584
star
28

heroku-fucking-console

When I run heroku console, I want a fucking console, dammit
Ruby
560
star
29

hookup

Automate the bundle/migration tedium of Rails with Git hooks
Ruby
478
star
30

vim-sexp-mappings-for-regular-people

vim-sexp mappings for regular people
Vim Script
428
star
31

vim-bundler

bundler.vim: Lightweight support for Ruby's Bundler
Vim Script
403
star
32

gem-ctags

Automatic ctags generation on gem install
Ruby
396
star
33

vim-tbone

tbone.vim: tmux basics
Vim Script
393
star
34

gem-shut-the-fuck-up

Gem SHUT THE FUCK UP
Ruby
377
star
35

vim-jdaddy

jdaddy.vim: JSON manipulation and pretty printing
Vim Script
354
star
36

vim-ragtag

ragtag.vim: ghetto HTML/XML mappings (formerly allml.vim)
Vim Script
352
star
37

vim-cucumber

Vim Cucumber runtime files
Vim Script
321
star
38

vim-vividchalk

vividchalk.vim: a colorscheme strangely reminiscent of Vibrant Ink for a certain OS X editor
Vim Script
313
star
39

pickler

PIvotal traCKer Liaison to cucumbER
Ruby
299
star
40

vim-characterize

characterize.vim: Unicode character metadata
Vim Script
286
star
41

vim-rake

rake.vim: it's like rails.vim without the rails
Vim Script
243
star
42

fivemat

MiniTest/RSpec/Cucumber formatter that gives each test file its own line of dots
Ruby
243
star
43

vim-flagship

flagship.vim: Configurable and extensible tab line and status line
Vim Script
225
star
44

gem-browse

gem edit, gem open, gem clone, gem browse
Ruby
221
star
45

vim-salve

salve.vim: static support for Leiningen and Boot
Vim Script
195
star
46

vim-dotenv

dotenv.vim: Basic support for .env and Procfile
Vim Script
192
star
47

vim-apathy

apathy.vim: Set the 'path' option for miscellaneous file types
Vim Script
178
star
48

vim-afterimage

afterimage.vim: edit binary files by converting them to text equivalents
Vim Script
163
star
49

vim-capslock

capslock.vim: Software caps lock
Vim Script
151
star
50

rbenv-ctags

Automatically generate ctags for rbenv Ruby stdlibs
Shell
147
star
51

rbenv-aliases

Create aliases for rbenv Ruby versions
Shell
129
star
52

vim-liquid

Vim Liquid runtime files with Jekyll enhancements
Vim Script
126
star
53

rbenv-communal-gems

Share gems across multiple rbenv Ruby installs
Shell
118
star
54

vim-rvm

rvm.vim: Switch Ruby versions from inside Vim
Vim Script
117
star
55

vim-classpath

classpath.vim: Set 'path' from the Java class path
Vim Script
110
star
56

rumember

Remember The Milk Ruby API and command line interface
Ruby
106
star
57

vim-heroku

heroku.vim: Heroku CLI wrapper
Vim Script
103
star
58

heroku-binstubs

Create binstubs to easily dispatch the heroku command for specific apps
Ruby
94
star
59

vim-haystack

haystack.vim: fuzzy matching algorithm
Vim Script
73
star
60

vim-rbenv

rbenv.vim: Minimal rbenv support
Vim Script
67
star
61

rbenv-readline

Automatically link rbenv Ruby installs to readline on OS X
Shell
63
star
62

heroku-wildcards

Run a Heroku command across multiple apps
Ruby
52
star
63

rails-default-database

Make database.yml optional in Rails
Ruby
48
star
64

heroku-pgbackups-pull

Import a Heroku PostgreSQL backup into your Rails development database
Ruby
46
star
65

pry-editline

C-x C-e to invoke an editor on the current pry (or irb) line
Ruby
46
star
66

heroku-surrogate

Run commands locally using a Heroku app's environment variables
Ruby
40
star
67

lein-dotenv

Leiningen plugin to merge .env into environment variables
Clojure
35
star
68

heroku-remote

Commands for working with (multiple) Heroku remotes
Ruby
28
star
69

vim-flatfoot

flatfoot.vim: experimental enhancement of "f" and "t" keys
Vim Script
26
star
70

ldaptic

Object-oriented schema-aware LDAP wrapper for Ruby
Ruby
24
star
71

chrome-defenestration

JavaScript
19
star
72

mta-settings

Configure ActionMailer or Mail delivery settings based on the environment
Ruby
12
star
73

zerbo

Zeo Personal Sleep Coach Ruby Interface
Ruby
12
star
74

girth

Git Interactive Ruby Toolset . . . Hippopotamus?
Ruby
11
star
75

.github

this doesn't work does it?
11
star
76

artifice-passthru

Artifice extension that allows you to let certain requests pass thru to use HTTP
Ruby
8
star
77

rbenv-sentience

Make rbenv self aware
Shell
8
star
78

rack-taint

Rack middleware to taint incoming data
Ruby
7
star
79

tpope.github.com

5
star