Skip to content

socialviolation/git-calver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-calver

git calver is intended as a git subcommand utility, to manipulate git tags using CalVer.

Installation

go install github.com/socialviolation/git-calver

Set up

calver requires a CalVer format to be provided.

# .git/config setting - Lowest Priority
$ git calver format
YYYY.0M
# It can be set with calver
$ git calver format set --format="YYYY.0M"

# OR Environment Var - medium priority
export CALVER="YYYY.0M.0D"

# OR FLAG - highest priority
$ git calver tag --format="YY.0M.DD"

# specify `-AUTO` for auto-incrementing
$ git calver tag --format="YY.0M-AUTO"

Usage

$ git calver help
CalVer is a git subcommand for managing a calendar versioning tag scheme.

Usage:
  git-calver [flags]
  git-calver [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  format      Get format from .gitconfig
  help        Help about any command
  latest      Get latest tag matching the provided format
  list        Will list all CalVer tags matching the provided format
  next        Output what the next calver tag will be
  retag       retag
  tag         tag
  untag       untag

Flags:
  -d, --dry-run           Dry run
  -f, --format string     format of calver (YYYY.0M.0D)
  -h, --help              help for git-calver
      --micro uint        Micro Version
      --minor uint        Minor Version
      --modifier string   Modifer (eg. DEV, RC, etc)

Use "git calver [command] --help" for more information about a command.

Supported Formats

Review calver.go for the calver format spec

Supported values are as follows:

// FullYear notation - 2006, 2016, 2106
FullYear = "YYYY"
// ShortYear notation - 6, 16, 106
ShortYear = "YY"
// PaddedYear notation - 06, 16, 106
PaddedYear = "0Y"
// ShortMonth notation - 1, 2 ... 11, 12
ShortMonth = "MM"
// PaddedMonth notation - 01, 02 ... 11, 12
PaddedMonth = "0M"
// ShortWeek notation - 1, 2, 33, 52
ShortWeek = "WW"
// PaddedWeek notation - 01, 02, 33, 52
PaddedWeek = "0W"
// ShortDay notation - 1, 2 ... 30, 31
ShortDay = "DD"
// PaddedDay notation - 01, 02 ... 30, 31
PaddedDay = "0D"
// Auto Increment notation - `-AUTO` 
Auto = "-AUTO"

Minor = "MINOR"
Micro = "MICRO"