From 09ef4d4d9339a56cbc02183eeb755ce9d6899fd0 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sun, 15 May 2022 08:54:03 +0200 Subject: [PATCH] git: Replace git-signoff with `rebase --signoff` Replace my custom git-signoff script with the native `--signoff` flag for `git rebase`. --- .config/git/config | 2 +- .config/zsh/autoload/git/git-signoff | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100755 .config/zsh/autoload/git/git-signoff diff --git a/.config/git/config b/.config/git/config index 5c3e881..e02e540 100644 --- a/.config/git/config +++ b/.config/git/config @@ -16,7 +16,7 @@ checkout-worktree = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-checkout-worktree\"" filter-repo = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/git/git-filter-repo/git-filter-repo\"" flog = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/glog\"" - signoff = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-signoff\"" + signoff = rebase --signoff ssync = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-ssync\"" track = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-track\"" [blame] diff --git a/.config/zsh/autoload/git/git-signoff b/.config/zsh/autoload/git/git-signoff deleted file mode 100755 index 49d9a35..0000000 --- a/.config/zsh/autoload/git/git-signoff +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env zsh -## Author: Julian Prein -## Created: 2022-03-29 -## -## Signoff range of commits - -# Exit if not in git repo -git rev-parse || return - -# Exit if no arguments were given -[[ $# -gt 0 ]] || return - -# Signoff all commits -env GIT_SEQUENCE_EDITOR="sed -Ei 's/^p(ick)?/e/'" git rebase -i "$@" || return - -while git rebase --show-current-patch &>/dev/null; do - git commit --amend --signoff --no-edit --no-verify - git rebase --continue -done - -return 0