Created
June 16, 2022 02:23
-
-
Save whinc/c23d749dcd1bb66fc21590d9bfc12b83 to your computer and use it in GitHub Desktop.
print commit messages betweenb the last two commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # 获取最近两次发布(通过tag判断)之间的提交记录 | |
| MODE="$1" | |
| EXCLUDE="" | |
| if [[ "$MODE" == "prod" ]]; then | |
| EXCLUDE="test@*" | |
| else | |
| EXCLUDE="prod@*" | |
| fi | |
| tagName="$(git describe --tags --exclude "debug@*" --exclude "v*" --exclude "$EXCLUDE" HEAD^1)" | |
| git log --pretty="format:%an | %ar | %s" "${tagName:0:19}"...HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment