open-cas-linux/tools/version2sha
Rafal Stefanowski acec05060d Fix license
Change license to BSD-3-Clause

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-28 12:46:42 +02:00

14 lines
264 B
Bash
Executable File

#!/bin/bash
#
# Copyright(c) 2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
VERSION=$1
MERGE=$(echo "$VERSION" | cut -d. -f 4)
SHA=$(git log --merges --oneline | tac | sed "${MERGE}q;d" | cut -d " " -f 1)
[[ -z "$SHA" ]] && exit 1
echo "$SHA"