From 94270f34e88a40106f20800ed9063ede932cd6f4 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 18 Sep 2023 01:20:59 +0200 Subject: [PATCH] feat(git): add alias to commit with previous message --- users/myuser/git.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/users/myuser/git.nix b/users/myuser/git.nix index 314f582..77ab8d2 100644 --- a/users/myuser/git.nix +++ b/users/myuser/git.nix @@ -21,16 +21,19 @@ t = "tag -s -m ''"; ci = "commit -v -S"; cam = "commit -v -S --amend"; - fixup = ''!f() { TARGET=$(git rev-parse \"$1\"); git commit --fixup=$TARGET ''${@:2} && EDITOR=true git rebase -i --gpg-sign --autostash --autosquash $TARGET^; }; f''; + fixup = ''!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ''${@:2} && EDITOR=true git rebase -i --gpg-sign --autostash --autosquash $TARGET^; }; f''; + commit-reuse-message = ''!git commit --edit --file "$(git rev-parse --git-dir)"/COMMIT_EDITMSG''; + cir = "commit-reuse-message -v -S"; }; }; home.shellAliases = rec { g = "gitui"; - gs = "git status"; ga = "git add"; - gc = "git commit -v -S"; - gca = "${gc} --amend"; - # TODO command to make new commit with old commit editmsg, beware worktrees have different path + gc = "git ci"; + gca = "git ci --amend"; + gcl = "git clone"; + gcr = "git cir"; + gs = "git s"; }; }