git: tune defaults

This commit is contained in:
2025-09-09 22:05:32 +00:00
parent 6acd76fbb5
commit 3d37f743e7

View File

@@ -26,6 +26,7 @@ in
sandbox.whitelistPwd = true; sandbox.whitelistPwd = true;
sandbox.autodetectCliPaths = "parent"; # autodetection is necessary for git-upload-pack; "parent" so that `git mv` works sandbox.autodetectCliPaths = "parent"; # autodetection is necessary for git-upload-pack; "parent" so that `git mv` works
sandbox.extraHomePaths = [ sandbox.extraHomePaths = [
".config/nvim"
# even with `whitelistPwd`, git has to crawl *up* the path -- which isn't necessarily in the sandbox -- to locate parent .git files # even with `whitelistPwd`, git has to crawl *up* the path -- which isn't necessarily in the sandbox -- to locate parent .git files
"dev" "dev"
"knowledge" "knowledge"
@@ -33,6 +34,7 @@ in
"ref" "ref"
]; ];
sandbox.whitelistSsh = true; sandbox.whitelistSsh = true;
fs.".config/git/config".symlink.text = mkCfg { fs.".config/git/config".symlink.text = mkCfg {
# top-level options documented: # top-level options documented:
# - <https://git-scm.com/docs/git-config#_variables> # - <https://git-scm.com/docs/git-config#_variables>
@@ -54,7 +56,11 @@ in
alias.st = "status"; alias.st = "status";
alias.stat = "status"; alias.stat = "status";
diff.noprefix = true; #< don't show a/ or b/ prefixes in diffs commit.verbose = true; #< have `git commit` populate both status *and* diff to the editor
diff.context = 8; #< default 3 lines of context
diff.interHunkContext = 8; #< include up to this many extra lines to merge diff hunks
diff.noPrefix = true; #< don't show a/ or b/ prefixes in diffs
# difftastic docs: # difftastic docs:
# - <https://difftastic.wilfred.me.uk/git.html> # - <https://difftastic.wilfred.me.uk/git.html>
diff.tool = "difftastic"; diff.tool = "difftastic";
@@ -62,12 +68,17 @@ in
"difftool \"difftastic\"".cmd = ''difft "$LOCAL" "$REMOTE"''; "difftool \"difftastic\"".cmd = ''difft "$LOCAL" "$REMOTE"'';
# now run `git difftool` to use difftastic git # now run `git difftool` to use difftastic git
# render dates as YYYY-MM-DD HH:MM:SS +TZ log.date = "iso"; #< render dates as YYYY-MM-DD HH:MM:SS +TZ
log.date = "iso"; log.follow = true; #< make `git log PATH` behave like `git log --follow PATH`
log.showSignature = false;
rebase.autoStash = true; #< make `git rebase FOO` behave as `git stash && git rebase FOO && git stash apply`
sendemail.annotate = "yes"; sendemail.annotate = "yes";
sendemail.confirm = "always"; sendemail.confirm = "always";
status.short = true; #< make `git statues` behave as `git status --short`
stash.showPatch = true; stash.showPatch = true;
}; };
}; };