Giter Site home page Giter Site logo

svu's Introduction

svu

Build Status

Semantic Version Util is a tool to manage semantic versions at ease!

You can print the current version, increase patch/minor/major manually or just get the next tag based on your git log!

Example usage:

svu

Based on the log between the latest tag and HEAD, prints the next tag.

aliases: svu next and svu n

$ svu
v1.3.0

Commit messages vs what they do:

Commit message Tag increase
fix: fixed something Patch
feat: added new button to do X Minor
fix: fixed thing xyz

BREAKING CHANGE: this will break users because of blah
Major
fix!: fixed something Major
feat!: added blah Major
chore: foo Nothing

svu current

Prints the latest tag.

alias: svu c

$ svu current
v1.2.3

svu major

Increases the major of the latest tag and prints it.

$ svu major
v2.0.0

svu minor

Increases the minor of the latest tag and prints it.

alias: svu m

$ svu minor
v1.3.0

svu patch

Increases the patch of the latest tag and prints it.

alias: svu p

$ svu patch
v1.2.4

Tag mode

By default svu will get the latest tag from the current branch. Using the --tag-mode flag this behaviour can be altered:

Flag Description Git command used under the hood
--tag-mode current-branch Get latest tag from current branch. git describe --tags --abbrev=0
--tag-mode all-branches Get latest tag accross all branches. git describe --tags $(git rev-list --tags --max-count=1)

Discarding pre-release and build metadata

To discard pre-release and/or build metadata information you can run your comman dof choice with the following flags:

Flag Description Example
--no-metadata Discards pre-release and build metadata. v1.0.0-alpha+build.f902daf -> v1.0.0
--no-pre-release Discards pre-release metadata. v1.0.0-alpha -> v1.0.0
--no-build Discards build metadata. v1.0.0+build.f902daf -> v1.0.0

Force patch version increment

Setting the --force-patch-increment flag forces a patch version increment regardless of the commit message content.

Creating tags

The idea is that svu will just print things, so its safe to run at any time.

You can create tags by wrapping it in an alias. For example, I have one like this:

alias gtn='git tag $(svu next)'

So, whenever I want to create a tag, I just run gtn.

Install

go get github.com/caarlos0/svu

or

brew install caarlos0/tap/svu

or

curl -sfL https://install.goreleaser.com/github.com/caarlos0/svu.sh | bash -s -- -b /usr/local/bin

Or download one from the releases tab and install manually.

svu's People

Contributors

caarlos0 avatar dominiklessel avatar renovate[bot] avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.