gbch

package module
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 23 Imported by: 0

README

gbch

Build Status MIT License

Description

Generate changelog from git history, tags and merged pull requests for Backlog

Installation

% go get github.com/vvatanabe/gbch/cmd/gbch/

Synopsis

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

Options

Options
-r, --repo=         git repository path (default: .)
-g, --git=          git path (default: git)
-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
    --apikey=       backlog api key
    --remote=       default remote name (default: origin)
-F, --format=       json or markdown
-A, --all           output all changes
-N, --next-version=
-w                  write result to file
    --show-uid      show the unique id on nulab account (Only user integrated with nulab account)

Backlog API Key

Backlog's api key is required because this CLI depends on Backlog API v2, it is used in the following order of priority.

  • command line option --apikey
  • enviroment variable BACKLOG_API_KEY

Requirements

git 1.8.5 or newer is required.

Examples

display all changes
% gbch --format=markdown --next-version=v0.30.3 --all
...
display changes between specified two revisions
% gbch --from v0.9.0 --to v0.9.1
...

Acknowledgments

gbch's origin is github.com/Songmu/ghch. I appreciate it a lot.

Bugs and Feedback

For bugs, questions and discussions please use the GitHub Issues.

Author

vvatanabe

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	OutStream, ErrStream io.Writer
}

CLI is struct for command line tool

func (*CLI) Run

func (cli *CLI) Run(argv []string) int

Run the gbch

type Changelog

type Changelog struct {
	Sections []Section `json:"Sections"`
}

Changelog contains Sections

type Gbch

type Gbch struct {
	RepoPath     string `short:"r" long:"repo" default:"." description:"git repository path"`
	GitPath      string `short:"g" long:"git" default:"git" description:"git path"`
	From         string `short:"f" long:"from" description:"git commit revision range start from"`
	To           string `short:"t" long:"to" description:"git commit revision range end to"`
	Latest       bool   `          long:"latest" description:"output changes between latest two semantic versioned tags"`
	APIKey       string `          long:"apikey" description:"backlog api key"`
	Remote       string `          long:"remote" default:"origin" description:"default remote name"`
	Format       string `short:"F" long:"format" default:"json" description:"json or markdown or backlog"`
	All          bool   `short:"A" long:"all" description:"output all changes"`
	NextVersion  string `short:"N" long:"next-version"`
	Write        bool   `short:"w" description:"write result to file"`
	ShowUniqueID bool   `          long:"show-uid" description:"show the unique id on nulab account"`
	VerPrefix    string `          long:"ver-prefix" description:"custom version prefix (ex. foo-1.2.3)"`
	ChangelogMd  string
	// Tmpl string
	OutStream io.Writer

	BaseURL    string
	ProjectKey string
	RepoName   string
	// contains filtered or unexported fields
}

Gbch is main application struct

func (*Gbch) Run

func (gb *Gbch) Run() error

Run the ghch

type Section

type Section struct {
	PullRequests []*backlog.PullRequest `json:"pull_requests"`
	FromRevision string                 `json:"from_revision"`
	ToRevision   string                 `json:"to_revision"`
	ChangedAt    time.Time              `json:"changed_at"`
	Project      string                 `json:"project"`
	Repo         string                 `json:"repo"`
	BaseURL      string                 `json:"-"`
	HTMLURL      string                 `json:"html_url"`
	ShowUniqueID bool                   `json:"-"`
}

Section contains changes between two revisions

Directories

Path Synopsis
cmd
gbch command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL