From aed71f1d7b187b4b2fe2f5cc9b82b2f6e53bc5dd Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 3 Jul 2024 23:10:51 +0200 Subject: [PATCH] home/git: set some more configuration --- home/config/ssh/pvv.nix | 10 +++++++-- home/programs/git.nix | 48 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/home/config/ssh/pvv.nix b/home/config/ssh/pvv.nix index 3485269..d7d1404 100644 --- a/home/config/ssh/pvv.nix +++ b/home/config/ssh/pvv.nix @@ -88,8 +88,14 @@ let machines: pipe machines pipeline; in { - programs.ssh.matchBlocks = extendedLib.attrsets.concatAttrs [ + programs.ssh.matchBlocks = (extendedLib.attrsets.concatAttrs [ (convertMachinesWith convertNormalMachine normalMachines) (convertMachinesWith convertAdminMachine rootMachines) - ]; + ]) // { + "pvv-git git.pvv.ntnu.no" = { + hostname = "git.pvv.ntnu.no"; + user = "gitea"; + port = 2222; + }; + }; } diff --git a/home/programs/git.nix b/home/programs/git.nix index ff65846..598ceca 100644 --- a/home/programs/git.nix +++ b/home/programs/git.nix @@ -42,6 +42,8 @@ editor = "nvim"; }; + safe.directory = "*"; + rerere.enabled = true; branch.sort = "-committerdate"; @@ -50,9 +52,25 @@ color.ui = "auto"; init.defaultBranch = "main"; - fetch.prune = true; + + fetch = { + prune = true; + fsckObjects = true; + }; + + transfer.fsckObjects = true; + + receive.fsckObjects = true; + pull.rebase = true; + rebase = { + autoStash = true; + autoSquash = true; + abbreviateCommands = true; + updateRefs = true; + }; + push = { default = "current"; autoSetupRemote = true; @@ -72,8 +90,19 @@ mnemonicPrefix = true; renames = true; tool = "nvimdiff"; + submodule = "log"; }; + status = { + showUntrackedFiles = "all"; + relativePaths = true; + submoduleSummary = true; + }; + + log.date = "iso"; + + submodule.recurse = true; + grep = { break = true; heading= true; @@ -81,10 +110,25 @@ extendedRegexp = true; }; + # Run autocorrected command after 3 seconds + help.autocorrect = "30"; + github.user = "h7x4"; - "url \"github:\"".insteadOf = "https://github.com/"; + "url \"github:\"".insteadOf = [ + "https://github.com/" + "ssh://git@github.com:" + "git@github.com:" + "github.com:" + ]; + "url \"pvv-git:\"".insteadOf = [ + "https://git.pvv.org/" + "ssh://gitea@git.pvv.ntnu.no:2222/" + "gitea@git.pvv.ntnu.no:2222/" + "gitea@git.pvv.ntnu.no:" + "git.pvv.ntnu.no:" + ]; web.browser = "google-chrome-stable";