-{ pkgs, lib, config, ... }:
+{
+ pkgs,
+ lib,
+ config,
+ ...
+}:
{
home.packages = lib.mkIf config.programs.git.enable [
pkgs.b4
pkgs.delta
pkgs.difftastic
+ pkgs.gh
pkgs.git-absorb
pkgs.git-bug
pkgs.git-chglog
];
programs.git = {
enable = lib.mkDefault true;
- ignores = [ "*~" "*.swp" ];
+ ignores = [
+ "*~"
+ "*.swp"
+ ];
package = lib.mkDefault pkgs.gitMinimal;
aliases = {
a = "add";
+ ai = "add --intent-to-add";
ab = "absorb";
abr = "absorb -r";
ap = "add -p";
pf = "push -v --force-with-lease --force-if-includes";
pl = "pull";
r = "reset";
+ repack-1 = "git repack -a -d -f --depth=1 --window=1";
+ repack-250 = "git repack -a -d -f --depth=250 --window=250";
rh = "reset --hard";
ri = "rebase -i";
rp = "reset -p";
wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads";
};
extraConfig = {
- browser.elinks.cmd = "elinks";
+ branch.sort = "-committerdate";
color.branch = "auto";
color.diff = "auto";
#color.diff.whitespace = "red reverse";
color.status = "auto";
+ column.ui = "auto";
+ commit.verbose = true;
+ #core.fsmonitor true
+ #core.untrackedCache true
core.commentChar = "auto";
core.quotepath = "false";
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
diff.algorithm = "histogram";
+ diff.colorMoved = "plain";
+ diff.mnemonicPrefix = true;
+ diff.renames = true;
diff.sqldiff.command = "sqldiff";
+ fetch.prune = true;
+ fetch.pruneTags = true;
+ fetch.all = true;
format.pretty = "oneline";
gui.fontdiff = ''-family "DejaVu Sans Mono" -size 8 -weight normal -slant roman -underline 0 -overstrike 0'';
gui.fontui = ''-family "DejaVu Sans" -size 8 -weight normal -slant roman -underline 0 -overstrike 0'';
cmd = "EDITOR=gvim git rebase -i $REVISION";
revprompt = true;
};
+ help.autocorrect = "prompt";
init.defaultBranch = "main";
merge.tool = "vimdiff";
merge.conflictStyle = "zdiff3";
protocol.version = 2;
pull.rebase = true;
+ push.autoSetupRemote = true;
push.default = "simple";
+ push.followTags = true;
push.useForceIfIncludes = true;
- rebase.autosquash = "true";
+ rebase.autoSquash = true;
+ rebase.autoStash = true;
+ rebase.updateRefs = true;
+ rerere.autoupdate = true;
+ rerere.enabled = true;
sendemail.chainReplyTo = "false";
sendemail.composeencoding = "UTF-8";
sendemail.confirm = "always";
sendemail.suppresscc = "self";
sendemail.thread = "true";
sendemail.validate = "true";
+ tag.sort = "version:refname";
web.browser = "elinks";
};
iniContent = {
/*
- diff.external = lib.concatStringsSep " " [
- "${pkgs.difftastic}/bin/difft"
- "--color auto"
- "--background dark"
- "--display side-by-side"
- ];
+ diff.external = lib.concatStringsSep " " [
+ "${pkgs.difftastic}/bin/difft"
+ "--color auto"
+ "--background dark"
+ "--display side-by-side"
+ ];
*/
# difftastic
/*
- diff.tool = "difftastic";
- difftool.prompt = false;
- difftool.difftastic.cmd = ''${pkgs.difftastic}/bin/difft "$LOCAL" "$REMOTE"'';
- pager.difftool = true;
+ diff.tool = "difftastic";
+ difftool.prompt = false;
+ difftool.difftastic.cmd = ''${pkgs.difftastic}/bin/difft "$LOCAL" "$REMOTE"'';
+ pager.difftool = true;
*/
# delta
/*
- core.pager = "delta --grep-separator-symbol keep";
- interactive.diffFilter = "delta --color-only --features=interactive";
- delta.features = "decorations";
- delta.interactive = {
- keep-plus-minus-markers = false;
- };
- delta.decorations = {
- commit-decoration-style = "blue ol";
- commit-style = "raw";
- file-style = "omit";
- hunk-header-decoration-style = "blue box";
- hunk-header-file-style = "red";
- hunk-header-line-number-style = "#067a00";
- hunk-header-style = "file line-number syntax";
- };
+ core.pager = "delta --grep-separator-symbol keep";
+ interactive.diffFilter = "delta --color-only --features=interactive";
+ delta.features = "decorations";
+ delta.interactive = {
+ keep-plus-minus-markers = false;
+ };
+ delta.decorations = {
+ commit-decoration-style = "blue ol";
+ commit-style = "raw";
+ file-style = "omit";
+ hunk-header-decoration-style = "blue box";
+ hunk-header-file-style = "red";
+ hunk-header-line-number-style = "#067a00";
+ hunk-header-style = "file line-number syntax";
+ };
*/
};
};