1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-24 20:41:31 +01:00

zsh: add git-fixup command (git fixup)

This commit is contained in:
bretello 2021-10-08 23:49:39 +02:00
parent f2850c54f1
commit 24999c4776
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
2 changed files with 7 additions and 3 deletions

View File

@ -66,8 +66,7 @@ alias gl5='git log -n 5'
alias pvim='poetry run vim' alias pvim='poetry run vim'
alias gs='git status' alias gs='git status'
alias gcf='git commit --fixup=HEAD' alias gcfx='git-fixup'
alias gcaf='git commit -a --fixup=HEAD'
alias gls="git log --pretty=oneline --abbrev-commit" # gls: Git Log Short alias gls="git log --pretty=oneline --abbrev-commit" # gls: Git Log Short
alias watcha='watch ' # note the space after watch. This makes watch work with aliases alias watcha='watch ' # note the space after watch. This makes watch work with aliases

View File

@ -306,7 +306,6 @@ function fgitlog() {
git log --oneline $@ | fzf --multi --preview 'git -p show --color=always {+1}' --preview-window=right,60% git log --oneline $@ | fzf --multi --preview 'git -p show --color=always {+1}' --preview-window=right,60%
} }
compdef _git fgitlog=git-log
git-commit-show() { git-commit-show() {
git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" | git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" |
fzf --ansi --no-sort --reverse --tiebreak=index --preview \ fzf --ansi --no-sort --reverse --tiebreak=index --preview \
@ -322,6 +321,12 @@ git-commit-show() {
--preview-window=right:60% --preview-window=right:60%
} }
compdef __git_recent_commits git-fixup
git-fixup() {
git commit --fixup=$1
git -c sequence.editor=true rebase --interactive --autosquash $1^
}
# dotfiles user functions # dotfiles user functions
if [[ -f $HOME/.dotfiles_functions ]]; then if [[ -f $HOME/.dotfiles_functions ]]; then
source "$HOME/.dotfiles_functions" source "$HOME/.dotfiles_functions"