Giter Club home page Giter Club logo

since's Introduction

since

CI Go Report Card Go Reference License

  • Parse git history and generate changelog.
  • Calculate the next version based on semver and conventional commits.
  • Parse changelog files and extract changes for a given version.

Installation

Homebrew

brew install release-tools/tap/since

Go

go install github.com/release-tools/since

Usage

Changelog - Parse and update changelog files.

Project - List the changes since the last release in the project repository, or determine the next semantic version based on those changes.


changelog generate

Generates a new changelog based on an existing changelog file, adding a new release section using the commits since the last release, then prints it to stdout.

Usage:
  since changelog generate [flags]

Flags:
  -g, --git-repo string   Path to git repository (default ".")
  -h, --help              help for generate
  -o, --order-by string   How to determine the latest tag (alphabetical|commit-date|semver)) (default "semver")

Global Flags:
  -c, --changelog string   Path to changelog file (default "CHANGELOG.md")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -q, --quiet              Disable logging (useful for scripting)

changelog update

Updates the existing changelog file with a new release section, using the commits since the last release.

Usage:
  since changelog update [flags]

Flags:
  -g, --git-repo string   Path to git repository (default ".")
  -h, --help              help for update
  -o, --order-by string   How to determine the latest tag (alphabetical|commit-date|semver)) (default "semver")

Global Flags:
  -c, --changelog string   Path to changelog file (default "CHANGELOG.md")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -q, --quiet              Disable logging (useful for scripting)

changelog extract

Extracts changes for a given version in a changelog file. If no version is specified, the most recent version is used.

Usage:
  since changelog extract [flags]

Flags:
      --header           whether to include the version header in the output
  -h, --help             help for extract
  -v, --version string   Version to parse changelog for

Global Flags:
  -c, --changelog string   Path to changelog file (default "CHANGELOG.md")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -q, --quiet              Disable logging (useful for scripting)

changelog init

Initialises a new changelog file based on the specified git repository.

Usage:
  since changelog init [flags]

Flags:
  -g, --git-repo string   Path to git repository (default ".")
  -h, --help              help for init
  -o, --order-by string   How to determine the latest tag (alphabetical|commit-date|semver)) (default "semver")
      --unique            De-duplicate commit messages (default true)

Global Flags:
  -c, --changelog string   Path to changelog file (default "CHANGELOG.md")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -q, --quiet              Disable logging (useful for scripting)

project changes

Reads the commit history for the current git repository, starting from the most recent tag. Lists the commits categorised by their type.

Usage:
  since project changes [flags]

Flags:
  -h, --help   help for changes

Global Flags:
  -g, --git-repo string    Path to git repository (default ".")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -o, --order-by string    How to determine the latest tag (alphabetical|commit-date|semver)) (default "semver")
  -q, --quiet              Disable logging (useful for scripting)
  -t, --tag string         Include commits after this tag

project version

Reads the commit history for the current git repository, starting from the most recent tag. Returns the next semantic version based on the changes.

Changes influence the version according to conventional commits

Usage:
  since project version [flags]

Flags:
  -c, --current   Just print the current version
  -h, --help      help for version

Global Flags:
  -g, --git-repo string    Path to git repository (default ".")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -o, --order-by string    How to determine the latest tag (alphabetical|commit-date|semver)) (default "semver")
  -q, --quiet              Disable logging (useful for scripting)
  -t, --tag string         Include commits after this tag

project release

Generates a new changelog based on an existing changelog file, using the commits since the last release.

The changelog is then committed and a new tag is created with the new version.

Usage:
  since project release [flags]

Flags:
  -c, --changelog string   Path to changelog file (default "CHANGELOG.md")
  -h, --help               help for release

Global Flags:
  -g, --git-repo string    Path to git repository (default ".")
  -l, --log-level string   Log level (debug, info, warn, error, fatal, panic) (default "debug")
  -o, --order-by string    How to determine the latest tag (alphabetical|commit-date|semver)) (default "semver")
  -q, --quiet              Disable logging (useful for scripting)
  -t, --tag string         Include commits after this tag

since's People

Contributors

outofcoffee avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

since's Issues

Annotated tags are ignored

If you create an annotated version tag with a message like so:

git tag -m "Message" 0.2.0

The tag will not be considered when calculating the next tag.

So given the following commits where 0.2.0 is annotated, the calculated next version will be 0.2.0 because 0.2.0 is ignored and 0.1.0 is used as a starting point.

9f807d5 feat: Feature D
9f807d4 feat: Feature C (tag: 0.2.0)
9f807d3 feat: Feature B (tag: 0.1.0)
9f807d2 feat: Feature A
9f807d1 chore: Inital commit (tag: 0.0.1)

The next tag in this example should be 0.3.0.

since project version -o semver gives wrong next version

Given a repo with the following commits and tags (some commits obmitted):

  • 0.0.1 First commit
  • 0.1.0
  • 0.1.1
  • 0.1.2 Latest commit

I would assume that since project version -o semver would give me a next version of 0.1.3 but instead I get 0.1.0 as it sees 0.0.1 as the first commit.

$ since project version -o semver
DEBU[0000] most recent tag: 0.0.1
DEBU[0000] fetched 44 commits
DEBU[0000] commit types: [typo chore feat docs fix build]
DEBU[0000] bumping minor version
0.1.0

Using commit-date works - but shouldn't semver also use the latest commit as a starting point?

$ since project version -o commit-date
DEBU[0000] most recent tag: 0.1.2
DEBU[0000] fetched 15 commits
DEBU[0000] commit types: [docs fix build typo]
DEBU[0000] bumping patch version
0.1.3

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.