From afb5e136f1a4b74de6656c49baab59cfcc4d1aa5 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 15 Nov 2022 07:33:21 -0800 Subject: add some useful git aliases --- lib/common.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/common.nix b/lib/common.nix index f482bc6..a16d2da 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -132,6 +132,17 @@ in { authors = "shortlog -s -n"; slog = "log --stat"; glog = ''log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; + logbr = "log -r origin/HEAD..HEAD"; + mrd = "!cat <(git shortlog origin/HEAD..HEAD) <(git diff --stat origin/HEAD...HEAD)"; + extend = "!git commit --fixup $1 && git rebase --autosquash $1~"; + mr = lib.concatStringsSep " " [ + "!git push" + "-o merge_request.create" + "-o merge_request.label=ReleaseUpdate::NotRequired" + "-o merge_request.assign=$USER" + ''-o merge_request.title="$(git log -n1 --format=%s)"'' + ''-o merge_request.description="$(git log -n1 --format=%b | tr "\n" " ")"'' + ]; }; extraConfig = { commit.template = "${./git-commit-template}"; -- cgit v1.2.3