From dde5b3483806c8b536eac566ff12a447fcdb8482 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 7 Apr 2025 06:57:00 -0700 Subject: git configuration mostly applying stuff from https://blog.gitbutler.com/how-git-core-devs-configure-git/ --- nix/users/fcuny/git.nix | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'nix/users/fcuny/git.nix') diff --git a/nix/users/fcuny/git.nix b/nix/users/fcuny/git.nix index 81a9355..92f4f52 100644 --- a/nix/users/fcuny/git.nix +++ b/nix/users/fcuny/git.nix @@ -74,18 +74,35 @@ extraConfig = { core.whitespace = "trailing-space,space-before-tab"; - color.ui = "true"; + color.ui = true; - # abort if the remote branch does not match the local one - push.default = "simple"; + # nicer output + column.ui = "auto"; # https://adamj.eu/tech/2024/01/18/git-improve-diff-histogram/ diff.algorithm = "histogram"; init.defaultBranch = "main"; + # https://blog.gitbutler.com/how-git-core-devs-configure-git/ + push = { + # abort if the remote branch does not match the local one + default = "simple"; + autoSetupRemote = true; + followTags = true; + }; + + fetch = { + prune = true; + pruneTags = true; + all = true; + }; + pull.rebase = true; + rebase = { + autosquash = true; + updateRefs = true; # Automatically create a temporary stash entry before the # operation begins, and apply it after the operation ends. autoStash = true; @@ -93,8 +110,10 @@ missingCommitsCheck = "warn"; }; - branch.autosetuprebase = "remote"; - branch.sort = "authordate"; + branch = { + autosetuprebase = "remote"; + sort = "authordate"; + }; url = { "ssh://git@github.rbx.com/" = { -- cgit v1.2.3