about summary refs log tree commit diff stats
path: root/nix-conf/home/includes
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-11-18 12:12:57 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-11-18 12:12:57 +0000
commit55f64497a85304daa211c06957c4f01704a3912c (patch)
tree51354fafe18c83bd97fc79dbc70a3b5145d10a43 /nix-conf/home/includes
parent59dbe8806e428314db25c4a4bd9facd6bcb0bccf (diff)
downloaddotfiles-55f64497a85304daa211c06957c4f01704a3912c.tar.gz
Add git config
Diffstat (limited to 'nix-conf/home/includes')
-rw-r--r--nix-conf/home/includes/common.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/nix-conf/home/includes/common.nix b/nix-conf/home/includes/common.nix
index 5d64c5a..9deaaf6 100644
--- a/nix-conf/home/includes/common.nix
+++ b/nix-conf/home/includes/common.nix
@@ -26,6 +26,7 @@ in
     bottom
     broot
     curl
+    diff-so-fancy
     difftastic
     duf
     du-dust
@@ -167,5 +168,81 @@ in
       };
     };
   };
+
+  programs.git = {
+    enable = true;
+    userName = "David Morgan";
+    aliases = {
+      # difftastic
+      logt = "!sh -c 'GIT_EXTERNAL_DIFF=\"difft --background=dark\" git log -p --ext-diff'";
+      showt = "!show() { GIT_EXTERNAL_DIFF=difft git show \${1} --ext-diff; }; show";
+      difft = "difftool";
+      # "raw" output
+      rlog = "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less log"; # usually used with -p
+      rshow = "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less show";
+      rdiff = "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less diff";
+      #  copiable output (without line numbers or +/- indicators)
+      clog = "!git -c delta.line-numbers=false log"; # usually used with -p
+      cshow = "!git -c delta.line-numbers=false show";
+      cdiff = "!git -c delta.line-numbers=false diff";
+      # diff-so-fancy
+      flog = "!git -c core.pager=\"diff-so-fancy | less\" log"; # usually used with -p
+      fshow = "!git -c core.pager=\"diff-so-fancy | less\" show";
+      fdiff = "!git -c core.pager=\"diff-so-fancy | less\" diff";
+
+      upstream = "!git push -u origin HEAD";
+      update-master = "!git fetch origin master:master";
+      update-main = "!git fetch origin main:main";
+    };
+    extraConfig = {
+      core.editor = "vim";
+      diff = {
+        tool = "difftastic";
+        colorMoved = "default";
+      };
+      difftool = {
+        prompt = false;
+        difftastic = { cmd = ''difft "$LOCAL" "$REMOTE"''; };
+      };
+      merge = {
+        conflictstyle = "diff3";
+        ff = "only";
+      };
+      pull = {
+        ff = "only";
+        rebase = false;
+      };
+      push.autoSetupRemove = true;
+      rebase = {
+        # TODO
+        # autosquash = true;
+        autostash = true;
+      };
+    };
+    delta = {
+      enable = true;
+      options = {
+        line-numbers = true;
+        navigate = true;
+        light = false;
+        file-style = "bold yellow ul";
+        hunk-header-line-number-style = "brightyellow";
+      };
+    };
+    ignores = [
+      ".lein-repl-history"
+      ".lsp"
+      ".rebel_readline_history"
+      ".cider-repl-history"
+      "nohup.out"
+      "*.elc"
+      "*.eln"
+      "*~"
+    ];
+    signing = {
+      key = "9B436B1477A879C26CDB6604C171251002C200F2";
+      signByDefault = true;
+    };
+  };
 }
 
>42 43




                                                             
               
                                                                                                  
          
   
                                                                                                
                                                  
                    




                              









                                                                                                  
                                                  











                                                                                                  
                                                  

                    
cc?h=hlt&id=d18d1d3d2ac7ba0909db010649a94d01a65d98d4'>d18d1d3d ^




a796831f ^



a796831f ^

b24eb476 ^
a796831f ^
1f7e3c05 ^
79eef536 ^
21c27706 ^
79eef536 ^
a796831f ^


































d5f89e0f ^
a796831f ^




4ad0f652 ^
a796831f ^


c4e143d6 ^

1b76245c ^
c4e143d6 ^


1b76245c ^
c4e143d6 ^







08cf048f ^
79eef536 ^
b74443e5 ^
eb4eecea ^
a17f9186 ^
79eef536 ^
a17f9186 ^
a796831f ^
a796831f ^



79eef536 ^
a796831f ^
a072f674 ^
eb4eecea ^
a072f674 ^

a796831f ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132