Skip to content

Commit

Permalink
Include the original HEAD in the porcelain output
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #140)
  • Loading branch information
levitte committed May 16, 2023
1 parent 1fce24a commit b99e62f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions release-tools/stage-release.sh
Expand Up @@ -313,6 +313,7 @@ if ! orig_remote_url=$(git remote get-url $orig_remote 2>/dev/null); then
# If there is no registered remote, then $orig_remote is the URL
orig_remote_url="$orig_remote"
fi
orig_head=$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null || git rev-parse HEAD)

# Make sure it's a branch we recognise
if (echo "$orig_branch" \
Expand Down Expand Up @@ -481,15 +482,14 @@ $DEBUG >&2 "DEBUG: Source directory is $SOURCEDIR"

# We always expect to start from a state of development
if [ "$TYPE" != 'dev' ]; then
upstream=$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null || echo 'HEAD^')
if $clean_worktree; then
cat >&2 <<EOF
Not in a development branch.
Have a look at the git log, it may be that a previous crash left it in
an intermediate state and that need to drop the top commit:
git reset --hard $upstream
git reset --hard $orig_head
# WARNING! LOOK BEFORE YOU ACT, KNOW WHAT YOU DO
EOF
else
Expand Down Expand Up @@ -804,6 +804,7 @@ if $do_porcelain; then
if [ -n "$release_clone" ]; then
echo "clone_directory='$release_clone'"
fi
echo "orig_head='$orig_head'"
echo "metadata='$metadata'"
else
cat <<EOF
Expand Down

0 comments on commit b99e62f

Please sign in to comment.