From 3a994f278b098fbe7ab24d4499bdda3e7f84febc Mon Sep 17 00:00:00 2001 From: "Thomas G." <1809566+tomgrv@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:44:49 +0200 Subject: [PATCH] feat: add fixemoji util --- src/gitutils/_fixemoji.sh | 13 +++++++++++++ src/gitutils/devcontainer-feature.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/gitutils/_fixemoji.sh diff --git a/src/gitutils/_fixemoji.sh b/src/gitutils/_fixemoji.sh new file mode 100644 index 0000000..45b98a5 --- /dev/null +++ b/src/gitutils/_fixemoji.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +#### Goto repository root +cd "$(git rev-parse --show-toplevel)" >/dev/null + +#### Rewrite history to fix author +# Rewrite commit messages to add the appropriate emoji +git filter-branch --msg-filter 'npx --yes devmoji -t "$(cat)"' -- --all + +# Clean up the original refs +rm -rf .git/refs/original/ +git reflog expire --expire=now --all +git gc --prune=now diff --git a/src/gitutils/devcontainer-feature.json b/src/gitutils/devcontainer-feature.json index b97c2c2..6412886 100644 --- a/src/gitutils/devcontainer-feature.json +++ b/src/gitutils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Git Aliases", "id": "gitutils", - "version": "1.6.3", + "version": "1.7.0", "description": "A feature to add useful Git aliases to your shell.", "installsAfter": [ "ghcr.io/devcontainers/features/common-utils",