Skip to content

Commit

Permalink
Fix staging_log script
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Schieder authored and Magnus Schieder committed Jul 3, 2024
1 parent 812afc2 commit 8101bc4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dev/scripts/staging_log.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/bin/bash

command -v awk > /dev/null || {
echo "Error: 'awk' not installed!"
command -v gawk > /dev/null || {
echo "Error: 'gawk' not installed!"
exit 1
}

REMOTE_NAME=upstream
git ls-remote --exit-code "$REMOTE_NAME" &>/dev/null ||
REMOTE_NAME=origin

STABLE=$(awk -v FS=. -v OFS=. '{$3="x" ; print $0}' VERSION)
STABLE=$(gawk -v FS=. -v OFS=. '{$3="x" ; print $0}' VERSION)
git fetch -q $REMOTE_NAME stable/$STABLE || exit 1

STAGING="$(git show "$REMOTE_NAME/stable/$STABLE:VERSION" | awk -v FS=. -v OFS=. '{$3=$3+1 ; print $0}')"
STAGING="$(git show "$REMOTE_NAME/stable/$STABLE:VERSION" | gawk -v FS=. -v OFS=. '{$3=$3+1 ; print $0}')"

git fetch -q $REMOTE_NAME staging/$STAGING || exit 1

git log --graph --oneline -U0 --submodule $REMOTE_NAME/stable/$STABLE..$REMOTE_NAME/staging/$STAGING | \
awk -v version="$STAGING" '
gawk -v version="$STAGING" '
/^*.*Staging update [0-9]{8}/ { printf("\n# %s-staging-%s-%s\n", version, $NF, substr($2, 0, 7)) }
/^*/ { printf(" %s\n",$0) }
/\| Submodule/ {printf(" %s %s\n", $3, $4)}
/\| >/ { $1=""; $2=""; printf(" %s\n", $0 )}
/^\| Submodule/ {printf(" %s %s\n", $3, $4)}
/^\| >/ { $1=""; $2=""; printf(" %s\n", $0 )}
'

0 comments on commit 8101bc4

Please sign in to comment.