Modify some of the git functions to use fzf

This commit is contained in:
Sameer Rahmani 2023-07-13 10:03:51 +01:00
parent e09ccf99d9
commit 521e4de26d
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
1 changed files with 5 additions and 4 deletions

View File

@ -152,7 +152,7 @@ function git_commits_from() {
}
function git_reset_branch_commits() {
git reset $(git merge-base $1 $(git branch --show-current))
git reset $(git merge-base "$1" $(git branch --show-current))
}
function git_uncommit() {
@ -161,15 +161,16 @@ function git_uncommit() {
}
function git_show_branch_filter() {
git show $(g log --pretty=format:"%h %an %ad %s" origin/HEAD..HEAD |filter|cut -d ' ' -f 1 |xargs)
git show $(g log --pretty=format:"%h %an %as %s" origin/HEAD..HEAD |fzf --reverse --height 40%|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)
git show $(g log --pretty=format:"%h %an %as %s" |fzf --reverse --height 40%|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)
#git commit "$1" --fixup $(g log --pretty=format:"%h %an %ad %s" origin/HEAD..HEAD |filter|cut -d ' ' -f 1 |xargs)
git commit "$@" --fixup $(g log --pretty=format:"%h %an %ad %s" --reverse origin/HEAD..HEAD |fzf --reverse --height 40%|cut -d ' ' -f 1 |xargs)
}
#this is unlikely to change so make it all statically assigned