Posted Jan 8, 2020 2020-01-08T20:10:00+02:00 by Rahul Chandna
Updated Aug 14, 2021 2021-08-14T14:23:34+02:00
Get the last tag name
1
| $ git describe --tags --abbrev=0
|
Now get all changes from last tag till now
1
| $ git log $(git describe --tags --abbrev=0)..HEAD
|
Now grep all commit messages that have JIRA mentioned in them
1
| $ git log $(git describe --tags --abbrev=0)..HEAD |grep "JIRA"
|
Now remove all merge request information
1
| $ git log $(git describe --tags --abbrev=0)..HEAD |grep "JIRA" | grep -v "\bCloses\W\|\bMerge branch\W\|\borigin/CISR\|\bResolve\W"
|
Now sort the commit messages and return only unique records
1
| $ git log $(git describe --tags --abbrev=0)..HEAD |grep "JIRA" | grep -v "\bCloses\W\|\bMerge branch\W\|\borigin/CISR\|\bResolve\W" | sort| uniq
|
Use awk to find all commit messages that start with word JIRA
1
| $ git log $(git describe --tags --abbrev=0)..HEAD | awk '$1 ~ /^JIRA/'
|
Now sort the commit messages and return only unique records
1
| $ git log $(git describe --tags --abbrev=0)..HEAD | awk '$1 ~ /^JIRA/' | sort | uniq
|
1
| $ git log --no-merges --oneline --format=%s $(git describe --tags --abbrev=0)..HEAD
|
- –no-merges : remove all merge information
- –oneline : remove date and author information
- –format=%s : %s is to return the commit message and removing the commit hash information
Now sort the commit messages and return only unique records
1
| $ git log --no-merges --oneline --format=%s $(git describe --tags --abbrev=0)..HEAD | sort | uniq
|