Code Monkey home page Code Monkey logo

ghch's Introduction

ghch

Test Status MIT License PkgGoDev

Description

Generate changelog from git history, tags and merged pull requests

Installation

% go install github.com/Songmu/ghch/cmd/ghch@latest

Synopsis

% ghch -r /path/to/repo [--format markdown]

Options

-r, --repo=         git repository path (default: .)
-f, --from=         git commit revision range start from
-t, --to=           git commit revision range end to
    --latest        output changes between latest two semantic versioned tags
-v, --verbose
-F, --format=       json or markdown (default: json)
-A, --all           output all changes
-N, --next-version=
-g, --git=          git path (default: git)
    --token=        github token
    --remote=       default remote name (default: origin)

GITHUB Token

When github's api token is required in private repository etc., it is used in the following order of priority.

  • command line option --token
  • enviroment variable GITHUB_TOKEN
  • git config github.token

GitHub Enterprise

You can use ghch for GitHub Enterprise. Change API endpoint via the enviromental variable.

$ export GITHUB_API=http://github.company.com/api/v3

Requirements

git 1.8.5 or newer is required.

Examples

display changes from last versioned tag

% ghch
{
  "pull_requests": [
    {
      "html_url": "https://github.com/mackerelio/mackerel-agent/pull/221",
      "title": "Fix typo",
      "number": 221,
      "state": "closed",
      "user": {
        "login": "yukiyan",
        "avatar_url": "https://avatars.githubusercontent.com/u/7304122?v=3",
        "type": "User"
      },
      "body": "Just fixing a typo 😄 ",
      "created_at": "2016-04-19T08:27:30Z",
      "updated_at": "2016-04-25T01:51:15Z",
      "merged_at": "2016-04-25T01:51:11Z",
      ...
      "merged_by": {
        "login": "stefafafan",
        "avatar_url": "https://avatars.githubusercontent.com/u/3520520?v=3",
        "type": "User"
      }
    },
    ...
  ],
  "from_revision": "v0.30.2",
  "to_revision": "",
  "changed_at": "2016-04-27T19:05:49+09:00",
  "owner": "mackerelio",
  "repo": "mackerel-agent"
}

display changes from last versioned tag in markdown

% ghch --format=markdown --next-version=v0.30.3
## [v0.30.3](https://github.com/mackerelio/mackerel-agent/releases/tag/v0.30.3) (2016-04-27)

* retry retirement when api request failed [#224](https://github.com/mackerelio/mackerel-agent/pull/224) ([Songmu](https://github.com/Songmu))
* Fix comments [#222](https://github.com/mackerelio/mackerel-agent/pull/222) ([stefafafan](https://github.com/stefafafan))
* Remove go get cmd/vet [#223](https://github.com/mackerelio/mackerel-agent/pull/223) ([itchyny](https://github.com/itchyny))
* [nit] [plugin.checks.foo ] is valid toml now [#225](https://github.com/mackerelio/mackerel-agent/pull/225) ([Songmu](https://github.com/Songmu))
* Remove usr local bin again [#217](https://github.com/mackerelio/mackerel-agent/pull/217) ([Songmu](https://github.com/Songmu))
* Fix typo [#221](https://github.com/mackerelio/mackerel-agent/pull/221) ([yukiyan](https://github.com/yukiyan))

display changes between two tags semantic versioned in markdown

% ghch -F markdown --latest
## [v0.2.0](https://github.com/Songmu/ghch/compare/v0.1.3...v0.2.0) (2018-01-01)

* introduce goxz for releasing and drop goxc dependency [#17](https://github.com/Songmu/ghch/pull/17) ([Songmu](https://github.com/Songmu))
* add --latest option for output changes between latest two semantic versioned tags [#16](https://github.com/Songmu/ghch/pull/16) ([Songmu](https://github.com/Songmu))
* fill oldest commit hash when from ref is empty [#15](https://github.com/Songmu/ghch/pull/15) ([Songmu](https://github.com/Songmu))

display all changes

% ghch --format=markdown --next-version=v0.30.3 --all
...

display changes between specified two revisions

% ghch --from v0.9.0 --to v0.9.1
...

Author

Songmu

ghch's People

Contributors

griffin-stewie avatar handlename avatar haya14busa avatar kennyj avatar mechairoi avatar pda avatar pyama86 avatar shmokmt avatar songmu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ghch's Issues

Add the installation guide with aqua to the document

Hi, thank you for your great project!

We suggest to add the installation guide with aqua to the document.
aqua is a declarative CLI Version Manager.
You can install this tool with aqua.

aqua init # Create aqua.yaml
aqua g -i Songmu/ghch # Add this tool to aqua.yaml
aqua i # Install tools

For the detail of aqua, please see the official document.

We expect you can just copy and paste the following guide to your document.


Install with aqua

You can install this tool with aqua.

aqua g -i Songmu/ghch # Add Songmu/ghch to aqua.yaml

Thank you.

This issue was created automatically by script. For the detail, please see here.

Minimum git version should be documented

Very minor issue, but I thought I'd mention it anyway.
Older versions of git (for example v1.8.3.1) don't support the -C option:

Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

Would be nice to include what minimum version of git is required somewhere in the documentation

socket: too many open filesエラーになる

Github Enterprise Cloudを利用している環境です。
tokenの部分はトリミングして表記していますが実行時には正式なものを指定しました。

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G95

$ go version
go version go1.13.7 darwin/amd64

$ ghch --token a6b48d88...
Get https://api.github.com/repos/org_name/repository_name/pulls/656: dial tcp 18.179.245.253:443: socket: too many open files
Get https://api.github.com/repos/org_name/repository_name/pulls/249: dial tcp 18.179.245.253:443: socket: too many open files
Get https://api.github.com/repos/org_name/repository_name/pulls/647: dial tcp 18.179.245.253:443: socket: too many open files

中略
途中からエラーの内容が変わりました

Get https://api.github.com/repos/org_name/repository_name/pulls/1309: tls: short read from Rand: open /dev/urandom: too many open files
Get https://api.github.com/repos/org_name/repository_name/pulls/227: x509: certificate signed by unknown authority
Get https://api.github.com/repos/org_name/repository_name/pulls/290: x509: certificate signed by unknown authority

複数回試したところ下記のようなエラーも起きていました。

$ ghch --token a6b48d88...
Get https://api.github.com/repos/org_name/repository_name/pulls/57: dial tcp: lookup api.github.com: no such host
Get https://api.github.com/repos/org_name/repository_name/pulls/681: dial tcp 18.179.245.253:443: socket: too many open files
Get https://api.github.com/repos/org_name/repository_name/pulls/206: dial tcp: lookup api.github.com: no such host

一応GITHUB_TOKEN環境変数を設定する方式、--token=を使うなどのパターンも試しましたが結果は変わりませんでした。

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.