Giter Site home page Giter Site logo

git-release-notes's Introduction

Release Notes

Generate release note pages from git commit history.

Installation

It's preferable to install it globally through npm

npm install -g git-release-notes

Usage

The basic usage is

cd <your_git_project>
git-release-notes <since>..<until> <template>

Where

  • <since>..<until> specifies the range of commits as in git log, see gitrevisions(7)
  • <template> is an ejs template file used to generate the release notes

Two templates are included as reference, markdown and html.

This are for instance the release notes generated from joyent/node running

git-release-notes v0.9.8..v0.9.9 html > changelog.html

Node's release notes

Custom template

The second parameter of git-release-notes can be any path to a valid ejs template files.

The only available template local variable is commits that is an array of commits, each containing

  • sha1 commit hash (%H)
  • authorName author name (%an)
  • authorEmail author email (%ae)
  • authorDate author date (%aD)
  • committerName committer name (%cn)
  • committerEmail committer email (%ce)
  • committerDate committer date (%cD)
  • title subject (%s)
  • messageLines array of body lines (%b)

Options

More advanced options are

  • p or path Git project path, defaults to the current working path
  • b or branch Git branch, defaults to master
  • t or title Regular expression to parse the commit title (see next chapter)
  • m or meaning Meaning of capturing block in title's regular expression
  • f or file JSON Configuration file, better option when you don't want to pass all parameters to the command line, for an example see options.json

Title Parsing

Some projects might have special naming conventions for the commit title.

The options t and m allow to specify this logic and extract additional information from the title.

For instance, Aria Templates has the following convention

fix #123 Title of a bug fix commit
feat #234 Title of a cool new feature

In this case using

git-release-notes -t "^([a-z]+) #(\d+) (.*)$" -m type -m issue -m title v1.3.6..HEAD html

generates the additional fields on the commit object

  • type first capturing block
  • issue second capturing block
  • title third capturing block (redefines the title)

Another project using similar conventions is AngularJs, commit message conventions.

git-release-notes -t "^(\w*)(?:\(([\w\$\.]*)\))?\: (.*)$" -m type -m scope -m title v1.1.2..v1.1.3 markdown

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.