diff options
author | Patrick Georgi <pgeorgi@google.com> | 2020-05-11 23:47:12 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-05-18 07:06:42 +0000 |
commit | 81a30ec3a72bf948ac17bc145bd9f7cda3884ad4 (patch) | |
tree | 31c92e7dbf1dcb25b34d7c3416a59694ec03caff /util/release/genrelnotes | |
parent | d906b21e2e1b5b4d5c1290436d4eaf1d5bc27070 (diff) |
util/release: Check that HEAD isn't used as reference
genrelnotes moves the tree between commits and so a relative location
like HEAD isn't stable. Since I ran into the HEAD issue while preparing
for two consecutive releases, let's guard against it.
Change-Id: I70c6812cdfe0d0671b3d653744a062d9920a2394
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41339
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/release/genrelnotes')
-rwxr-xr-x | util/release/genrelnotes | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/release/genrelnotes b/util/release/genrelnotes index 54933b0a59..5bd1a965e5 100755 --- a/util/release/genrelnotes +++ b/util/release/genrelnotes @@ -47,6 +47,11 @@ if [ "$1" == "--help" ] || [ -z "$1" ] || [ -z "$2" ]; then else OLD_GIT_VERSION="$1" NEW_GIT_VERSION="$2" + if [ "$OLD_GIT_VERSION" = "HEAD" -o "$NEW_GIT_VERSION" = "HEAD" ]; then + echo "Error: using HEAD as a reference doesn't work" + echo + exit 1 + fi TOTAL_COMMITS=$(git log --pretty=oneline \ "${OLD_GIT_VERSION}..${NEW_GIT_VERSION}" 2>/dev/null | wc -l) fi |