From 367fddb7c0cc9b98a600e839fc28393b867e99ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Fri, 2 Feb 2024 12:06:42 +0100 Subject: [PATCH] pkgs: add git-commit-last Small helper which adds a command git commit-last, which, as the name suggests, commits with the last commit message. Useful when the commit fails for whatever reason or something else happens during a commit. --- pkgs/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/default.nix b/pkgs/default.nix index 6a1b539..a75778d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,5 +10,13 @@ crane = inputs.crane.lib.${system}; fenix = inputs'.fenix.packages; }; + + packages.git-commit-last = pkgs.writeShellApplication { + name = "git-commit-last"; + text = '' + GITDIR="$(git rev-parse --git-dir)" + git commit -eF "$GITDIR/COMMIT_EDITMSG" + ''; + }; }; }