From 76eb7774ac0a1f44ca6b66b9322870cba24a50a8 Mon Sep 17 00:00:00 2001 From: axetroy Date: Fri, 27 Nov 2020 10:30:30 +0800 Subject: [PATCH] feat: rename tag:N to @N BREAKING CHANGE: rename ```diff - tag:0~tag:1 + @0~@1 ``` --- 1_parser/parser.go | 2 +- README.md | 6 +++--- cmd/whatchanged/main.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/1_parser/parser.go b/1_parser/parser.go index 855faddc..628b1b14 100644 --- a/1_parser/parser.go +++ b/1_parser/parser.go @@ -25,7 +25,7 @@ type Scope struct { var ( regShortHash = regexp.MustCompile(`^[a-z\d]{7}$`) regLongHash = regexp.MustCompile(`^[a-z\d]{40}$`) - regTag = regexp.MustCompile(`^tag:(\d+)$`) + regTag = regexp.MustCompile(`^@(\d+)$`) ) func getCommitFromHEAD(git *client.GitClient) (*object.Commit, error) { diff --git a/README.md b/README.md index bd156dab..9c279ec2 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ OPTIONS: --fmt=md. EXAMPLES: - # generate changelog from HEAD to . equivalent to 'whatchanged HEAD~tag:0' + # generate changelog from HEAD to . equivalent to 'whatchanged HEAD~@0' $ whatchanged # generate changelog of the specified version @@ -76,10 +76,10 @@ EXAMPLES: $ whatchanged v1.3.0~v1.2.0 # generate changelog from HEAD to - $ whatchanged ~tag:0 + $ whatchanged ~@0 # generate changelog from <0th tag> to <2th tag> - $ whatchanged tag:0~tag:2 + $ whatchanged @0~@2 # generate changelog from HEAD to specified version $ whatchanged HEAD~v1.3.0 diff --git a/cmd/whatchanged/main.go b/cmd/whatchanged/main.go index 0f9edddb..e88aaa5a 100644 --- a/cmd/whatchanged/main.go +++ b/cmd/whatchanged/main.go @@ -58,7 +58,7 @@ OPTIONS: --fmt=md. EXAMPLES: - # generate changelog from HEAD to . equivalent to 'whatchanged HEAD~tag:0' + # generate changelog from HEAD to . equivalent to 'whatchanged HEAD~@0' $ whatchanged # generate changelog of the specified version @@ -68,10 +68,10 @@ EXAMPLES: $ whatchanged v1.3.0~v1.2.0 # generate changelog from HEAD to - $ whatchanged ~tag:0 + $ whatchanged ~@0 # generate changelog from <0th tag> to <2th tag> - $ whatchanged tag:0~tag:2 + $ whatchanged @0~@2 # generate changelog from HEAD to specified version $ whatchanged HEAD~v1.3.0