glow

package module
v1.12.15-0...-edc2ec3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 6 Imported by: 0

README

Glow - A CLI Tool to adapt Git-Flow

Installation

Mac OS

brew tap meinto/glow https://github.com/meinto/glow
brew install meinto/glow/glow

Linux

GVERSION=$(curl https://api.github.com/repos/meinto/glow/releases/latest -s | jq .name -r | cut -c 2-)

# download i386 architecture
curl -Lo glow.tar.gz https://github.com/meinto/glow/releases/download/v${GVERSION}/glow_${GVERSION}_linux_i386.tar.gz
# or x86_64 architecture
curl -Lo glow.tar.gz https://github.com/meinto/glow/releases/download/v${GVERSION}/glow_${GVERSION}_linux_x86_64.tar.gz

tar -xvzf glow.tar.gz glow
mv glow /usr/local/bin/git-glow
rm glow.tar.gz

manually

Here you can find all available Binaries. Download the binary and run the install command:

<name-of-binary> install

Workflow

Important!
Some commands need additional information like git author or Gitlab namespace and project name.
These informations can be stored in a config file or can be passed through flags. To configure the glow.json config file run the "init" command

glow workflow

Feature Development

The following command will create a new feature branch in the following form: features/dvader/death-star. The name of the author (dvader) is grabbed from the config file.

# author grabbed from config
glow feature death-star

After you created the feature branch it is automatically checked out.
When you finish your feature you can create a merge request in Gitlab:

# Gitlab information grabbed from config
glow close
Create a release

I recommend to use Semver for versioning. The following command will create a release branch with the following format: release/v1.2.3.

glow release 1.2.3
Publish a release

When you decide that the release is stable and you want to publish it, the following command will create a merge request on the master branch in Gitlab.

glow publish
Close a release

After publishing the release, you have to merge all changes made on the release branch back into develop. The following command creates a merge request of the release branch into develop.

glow close

Config

For some commands you must provide information like the url of your Gitlab instance or your Gitlab ci token. These informations can be put in a glow.json file. Glow will lookup this json in the directory where its executed.

You can create this json with the init command. The json will be automatically added to the .gitignore:

glow init

List of all config params

glow.config.json

{
  "author": "dvadar",
  "gitProviderDomain": "https://gitlab.com",
  "gitProvider": "gitlab",
  "projectNamespace": "my-namespace",
  "projectName": "my-project",
  "gitPath": "/usr/local/bin/git",
  "squashCommits": true,
  "versionFile": "VERSION",
  "versionFileType": "raw",
  "logLevel": "info"
}

glow.private.json

{
  "token": "abc"
}

Git bindings

glow uses the native git installation per default. The default configured path to git is /usr/local/bin/git. You can change the path with the flag --gitPath or the property gitPath in the config file.

Documentation

Index

Constants

View Source
const (
	BRANCH_NAME_PREFIX     = "refs/heads/"
	FEATURE_BRANCH_PATTERN = `feature/[^/]+/.*`
	FIX_BRANCH_PATTERN     = `fix/[^/]+/.*`
	HOTFIX_BRANCH_PATTERN  = `hotfix/v.*`
	RELEASE_BRANCH_PATTERN = `release/v.*`
)
View Source
const (
	AUTHORED_BRANCH_TYPE_FEATURE = "feature"
	AUTHORED_BRANCH_TYPE_FIX     = "fix"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthoredBranch

type AuthoredBranch interface {
	Branch
}

AuthoredBranch definition

func AuthoredBranchFromBranchName

func AuthoredBranchFromBranchName(branchName string) (AuthoredBranch, error)

AuthoredBranchFromBranchName extracts a feature definition from branch name

func FeatureFromBranch

func FeatureFromBranch(branchName string) (b AuthoredBranch, err error)

FeatureFromBranch extracts a feature definition from branch name

func FixFromBranch

func FixFromBranch(branchName string) (b AuthoredBranch, err error)

FixFromBranch extracts a fix definition from branch name

func NewAuthoredBranch

func NewAuthoredBranch(branchType, author, featureName string) (AuthoredBranch, error)

NewAuthoredBranch creates a new branch definition

func NewFeature

func NewFeature(author, name string) (b AuthoredBranch, err error)

NewFeature creates a new feature definition

func NewFix

func NewFix(author, name string) (b AuthoredBranch, err error)

NewFix creates a new fix definition

type Branch

type Branch interface {
	CreationIsAllowedFrom(sourceBranch Branch) bool
	CanBeClosed() bool
	CanBePublished() bool
	CloseBranches(availableBranches []Branch) []Branch
	PublishBranch() Branch
	BranchName() string
	ShortBranchName() string
}

Branch interface

func BranchFromBranchName

func BranchFromBranchName(name string) (b Branch, err error)

func HotfixFromBranch

func HotfixFromBranch(branchName string) (b Branch, err error)

HotfixFromBranch extracts a fix definition from branch name

func NewBranch

func NewBranch(name string) Branch

NewBranch creates a new branch definition

func NewBranchLoggingService

func NewBranchLoggingService(b Branch) Branch

func NewHotfix

func NewHotfix(version string) (b Branch, err error)

NewHotfix creates a new hotfix definition

func NewRelease

func NewRelease(version string) (b Branch, err error)

NewRelease creates a new release definition

func ReleaseFromBranch

func ReleaseFromBranch(branchName string) (b Branch, err error)

ReleaseFromBranch extracts a release definition from branch name

Directories

Path Synopsis
Package mock_glow is a generated GoMock package.
Package mock_glow is a generated GoMock package.
git
__mock__
Package mock_git is a generated GoMock package.
Package mock_git is a generated GoMock package.
__mock__
Package mock_gitprovider is a generated GoMock package.
Package mock_gitprovider is a generated GoMock package.
pkg
cli
__mock__
Package mock_semver is a generated GoMock package.
Package mock_semver is a generated GoMock package.

Jump to

Keyboard shortcuts

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