Skip to content

Commit 72ed2ff

Browse files
committed
git: config improvements
1 parent 85514e3 commit 72ed2ff

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

home/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
age
5555
alejandra
5656
comma
57-
devenv
5857
inputs.agenix.packages.${pkgs.system}.default
5958
nh
6059
nix-tree

home/fish.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
cat = "bat";
9696
cloc = "tokei";
9797
dstat = "dool --color16";
98+
debug_attachable = "sudo sysctl -w kernel.yama.ptrace_scope=0";
9899
ext_brightness = "sudo ddcutil -d 1 setvcp 10";
99100
kloc = "kubectl --context=local";
100101
tcurl = "curl -s -o /dev/null -w 'time_namelookup: %{time_namelookup}\ntime_connect: %{time_connect}\ntime_appconnect: %{time_appconnect}\ntime_pretransfer: %{time_pretransfer}\ntime_redirect: %{time_redirect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n'";

home/git.nix

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{pkgs, ...}: {
1+
{
2+
pkgs,
3+
config,
4+
...
5+
}: {
26
home = {
37
packages = with pkgs; [
48
git
@@ -18,11 +22,12 @@
1822
delta = {
1923
enable = true;
2024
options = {
21-
navigate = "true";
22-
syntax-theme = "ansi";
2325
file-style = "omit";
24-
hunk-header-style = "file line-number syntax";
2526
hunk-header-decoration-style = "blue ul box";
27+
hunk-header-style = "file line-number syntax";
28+
navigate = "true";
29+
syntax-theme = "ansi";
30+
map-styles = "bold purple => syntax dim black, bold cyan => syntax #${config.colors.black}";
2631
};
2732
};
2833
difftastic = {
@@ -48,6 +53,7 @@
4853
# verbose log, i.e. with cherry marks
4954
log-pretty-verbose = "log --cherry-mark --pretty=format:'%C(yellow)%h %C(cyan)%m %C(green)%ad%C(red)%d %C(reset)%s%C(blue) [%an]' --date=relative";
5055
# aliases for use
56+
ln = "log-pretty";
5157
l = "!f() {
5258
if [ -z \"$1\" ]; then
5359
if [ \"$(git main)\" = \"$(git rev-parse --abbrev-ref HEAD)\" ]; then
@@ -72,7 +78,11 @@
7278
}; f";
7379
lg = "!f() {
7480
if [ -z \"$1\" ]; then
75-
git log-pretty-verbose --graph --boundary --cherry-mark $(git main)...
81+
if [ \"$(git main)\" = \"$(git rev-parse --abbrev-ref HEAD)\" ]; then
82+
git log-pretty-verbose --graph --boundary --cherry-mark -16
83+
else
84+
git log-pretty-verbose --graph --boundary --cherry-mark $(git main)...
85+
fi
7686
else
7787
git log-pretty-verbose --graph --boundary --cherry-mark $1
7888
fi
@@ -124,12 +134,26 @@
124134
skippedCherryPicks = false;
125135
};
126136
branch.sort = "-committerdate";
127-
commit.gpgsign = true;
137+
commit = {
138+
gpgsign = true;
139+
verbose = true;
140+
};
128141
core = {
129142
excludesfile = "~/.gitignore";
130143
};
131-
diff.algorithm = "histogram";
144+
diff = {
145+
algorithm = "histogram";
146+
colorMoved = "plain";
147+
mnemonicPrefix = true;
148+
renames = true;
149+
};
150+
fetch = {
151+
prune = true;
152+
pruneTags = true;
153+
all = true;
154+
};
132155
gpg.format = "ssh";
156+
help.autocorrect = "prompt";
133157
init.defaultBranch = "main";
134158
log.date = "local";
135159
merge = {
@@ -138,16 +162,20 @@
138162
};
139163
pull.rebase = true;
140164
push = {
141-
default = "current";
165+
default = "simple";
142166
autoSetupRemote = true;
167+
followTags = true;
143168
};
144169
rebase = {
145-
stat = true;
146170
autosquash = true;
147171
autostash = true;
172+
stat = true;
148173
updateRefs = true;
149174
};
150-
rerere.enabled = true;
175+
rerere = {
176+
enabled = true;
177+
autoupdate = true;
178+
};
151179
tag.sort = "version:refname";
152180
trim.confirm = false;
153181
url."ssh://[email protected]/".insteadOf = "https://github.com/";

0 commit comments

Comments
 (0)