Skip to content

Add git-semvers #795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 1 addition & 31 deletions bin/git-semvers
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
#!/usr/bin/env bash
#
# Originally from hangops slack
# Author: Daniel Hoherd http://github.com/danielhoherd

set -o pipefail
set -e

if [[ -n "$DEBUG" ]]; then
# shellcheck disable=SC2086
if [[ "$(echo $DEBUG | tr '[:upper:]' '[:lower:]')" == "verbose" ]]; then
set -x
fi
fi

function debug() {
if [[ -n "$DEBUG" ]]; then
echo "$@"
fi
}

function echo-stderr() {
echo "$@" 1>&2 ## Send message to stderr.
}

function fail() {
printf '%s\n' "$1" >&2 ## Send message to stderr. Exclude >&2 if you don't want it that way.
exit "${2-1}" ## Return a code specified by $2 or 1 by default.
}

function my-name() {
basename "$0"
}

function usage() {
echo "Usage: $(my-name) ARG ARG"
}

git tag -l "v*.*.*" --sort=-v:refname | awk -F. '!seen[$1,$2]++'
Loading