From 7718de596b7458b4b5171532f2e0fd7783771b09 Mon Sep 17 00:00:00 2001 From: anttiharju Date: Tue, 3 Sep 2024 22:28:01 +0300 Subject: [PATCH] Test swapping two topmost commits --- bin/gclone | 2 +- scripts/g-docs/commit.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/gclone b/bin/gclone index 0002dcd..40b6785 100755 --- a/bin/gclone +++ b/bin/gclone @@ -2,7 +2,7 @@ set -eu # Git CLONE: -# Clone a repo via SSH based on https URL or just the repo name. +# Clone a repo via SSH based on https URL or just the repo name. Change # Check if input argument is provided if [ $# -eq 0 ]; then diff --git a/scripts/g-docs/commit.sh b/scripts/g-docs/commit.sh index b79b477..015eb6e 100755 --- a/scripts/g-docs/commit.sh +++ b/scripts/g-docs/commit.sh @@ -20,3 +20,9 @@ name="github-actions[bot]" email="41898282+github-actions[bot]@users.noreply.github.com" GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git commit --no-verify -m \ "Update bin/g docs$source" + +# Swap the latest and the second latest commit, YOLO. +# Why: to keep actual commit message on top when opening the repo. +if [ -n "$source" ]; then + GIT_SEQUENCE_EDITOR="sed -i '' -n 'h;1n;2p;g;p'" git rebase -i HEAD~2 +fi