From 5da01d688fcfd4d1956197f7b7f9372e88687d05 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sat, 4 Nov 2023 16:52:03 +0300 Subject: 2023-11-04 --- modules/common/git.nix | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'modules/common/git.nix') diff --git a/modules/common/git.nix b/modules/common/git.nix index de401fb..da33eb2 100644 --- a/modules/common/git.nix +++ b/modules/common/git.nix @@ -59,17 +59,31 @@ in { extraConfig = { - advice.detachedHead = false; color.ui = true; core.whitespace = "trailing-space"; + init.defaultBranch = "master"; + status.submoduleSummary = true; + commit.verbose = 1; + push.autoSetupRemote = true; + pull.rebase = true; + rebase = { + autoStash = true; + autoSquash = true; + }; diff = { mnemonicPrefix = true; renames = "copies"; submodule = "log"; }; - init.defaultBranch = "master"; - push.autoSetupRemote = true; - status.submoduleSummary = true; + submodule.recurse = true; + sendemail = rec { + smtpServer = my.domain.shire; + smtpUser = "${my.username}@${smtpServer}"; + smtpEncryption = "ssl"; + smtpServerPort = 465; + annotate = true; + confirm = "always"; + }; github.user = my.username; gitlab.user = my.username; } @@ -95,10 +109,14 @@ in { git = "${config.hm.programs.git.package}/bin/git"; curl = "${pkgs.curl}/bin/curl"; in { - fuck = "!${git} reset --hard && ${git} clean -fdx"; + amend = "commit --amend"; + cat = "cat-file -p"; + fast = "clone --depth=1"; + fixup = "commit --fixup"; + fuck = "!${git} reset --hard && ${git} clean --force -dx"; + get = "pull --all --recurse-submodules --autostash"; gud = ''commit -m "git gud"''; - review = "!${git} lg @{push}.."; - reword = "commit --amend"; + refresh = "clean --force -X"; tree = "log --graph --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset'"; uncommit = "reset --soft HEAD~1"; untrack = "rm --cache --"; @@ -106,8 +124,7 @@ in { }; # All helper tools/editor generated files should go here. This must be - # kept relatively clean and void of any project-specific residual - # files. + # kept void of any project-specific or residual files. ignores = [ "*~" ".DS_Store" -- cgit v1.2.3