From 4cb2a109087addfaf20c5c4f0202f68e3e2c6d88 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 13 Nov 2021 11:06:24 +0900 Subject: git: fix alias "m" and "cpickc" --- .config/git/config | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to '.config/git/config') diff --git a/.config/git/config b/.config/git/config index 22acdc3..e82cf0b 100644 --- a/.config/git/config +++ b/.config/git/config @@ -104,13 +104,19 @@ ri = rebase -i rid = rebase -i develop rc = "!GIT_EDITOR=true git rebase --continue" - m = merge --no-edit + m = "!__fn() { \ + if [[ \"$1\" == --abort ]]; then \ + git merge --abort; \ + else \ + git merge --no-edit \"$@\"; \ + fi; \ + }; __fn" mc = "!GIT_EDITOR=true git merge --continue" mm = mergetool pullu = "!git pull upstream $(git current-branch) --ff" pullo = "!git pull origin $(git current-branch) --ff" pusho = "!git push origin $(git current-branch)" cpick = cherry-pick - cpickc = "!GIT_EDITOR=true cherry-pick --continue" + cpickc = "!GIT_EDITOR=true git cherry-pick --continue" empty = commit --allow-empty last-merge-commit = "!git rev-list --abbrev-commit --merges HEAD | head -n 1" -- cgit v1.2.3-70-g09d2