From ba88e4604634d00bd0ed5b23810f79fa799700fa Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Thu, 16 Jan 2025 22:11:50 +0100 Subject: [PATCH 1/2] lazygit: config via home-manager --- home/common.nix | 10 ++++++++++ home/modules/packages.nix | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/home/common.nix b/home/common.nix index 46cf0cf..657bb57 100644 --- a/home/common.nix +++ b/home/common.nix @@ -75,6 +75,16 @@ }; }; }; + programs.lazygit = { + enable = true; + settings = { + git = { + autoFetch = false; + mainBranches = ["main" "master" "mainline"]; + }; + update.method = "never"; + }; + }; # shell config programs.zsh = { diff --git a/home/modules/packages.nix b/home/modules/packages.nix index 73ac231..1d2a5f5 100644 --- a/home/modules/packages.nix +++ b/home/modules/packages.nix @@ -106,7 +106,6 @@ let ripgrep fd gitui - lazygit pre-commit scriv From 67904896a2797276b82202516f12e23550bd0cd3 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Thu, 16 Jan 2025 22:12:48 +0100 Subject: [PATCH 2/2] git: push --force-if-includes as default stronger protection against accidentally overwriting remote commits by another user, especially in the face of auto-fetching git clients. --- home/common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/common.nix b/home/common.nix index 657bb57..e38801a 100644 --- a/home/common.nix +++ b/home/common.nix @@ -44,6 +44,7 @@ extraConfig = { credential.helper = "cache"; push.default = "simple"; + push.forceIfIncludes = true; # avoid accidental force overrides when remote is autofetched in background init.defaultBranch = "mainline"; diff.tool = "vimdiff"; merge.tool = "vimdiff";