From e09ccf99d9216c099e21f4c43035caf44f13c933 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Thu, 24 Nov 2022 11:11:44 +0000 Subject: [PATCH] Add new git aliases for the new git functions --- aliases/common.alias | 3 +++ lib/git.zsh | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/aliases/common.alias b/aliases/common.alias index 78c2690..7d98635 100644 --- a/aliases/common.alias +++ b/aliases/common.alias @@ -39,6 +39,9 @@ alias pull="git_pull" alias pu="git_push" alias pl="git_pull" alias gr="git restore --staged" +alias show=git_show_branch_filter +alias show_all=git_show_filter +alias fixup=git_fixup alias kff="kernel_find_file" diff --git a/lib/git.zsh b/lib/git.zsh index e185677..b1d7693 100755 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -160,10 +160,14 @@ function git_uncommit() { git restore --staged . } -function git_show_filter() { +function git_show_branch_filter() { git show $(g log --pretty=format:"%h %an %ad %s" origin/HEAD..HEAD |filter|cut -d ' ' -f 1 |xargs) } +function git_show_filter() { + git show $(g log --pretty=format:"%h %an %ad %s" |filter|cut -d ' ' -f 1 |xargs) +} + function git_fixup() { git commit "$1" --fixup $(g log --pretty=format:"%h %an %ad %s" origin/HEAD..HEAD |filter|cut -d ' ' -f 1 |xargs) }