-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
151 lines (133 loc) · 4.65 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
151 lines (133 loc) · 4.65 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{{- $isWindows := (eq .chezmoi.os "windows") -}}
{{- $isWorkLinux := (and (eq .chezmoi.os "linux") (isExecutable "/usr/local/bin/this_is_work_pc")) -}}
{{- $isWorkWindows := (and (eq .chezmoi.os "windows") (isExecutable "C:\\Program Files\\Yt Env Checks\\this_is_work_pc.exe")) -}}
{{- $isWorkPC := (or $isWorkLinux $isWorkWindows) -}}
# =============================================================================
# User Configuration
# =============================================================================
[user]
name = Yuto Tanaka
{{- if $isWorkPC }}
# Work PC: Default to work credentials
{{- if $isWorkLinux }}
email = {{ (rbwFields "dotfiles-chezmoi").gitconfig_email.value }}
{{- else -}}
email = {{ (bitwardenFields "item" "083a244a-2d41-44a9-8e29-8f6434e74133").gitconfig_email.value }}
{{- end }}
{{- else }}
# Personal PC: Default to personal credentials
email = "git@mimikun.dev"
{{- end }}
# =============================================================================
# Core Configuration
# =============================================================================
[core]
autocrlf = false
ignorecase = false
editor = nvim
quotepath = false
excludesfile = ~/.gitignore_global
pager = delta
{{- if $isWindows }}
filemode = false
{{- end }}
[color]
ui = true
[credential]
{{- if $isWindows }}
helper = manager
{{- else }}
helper = cache --timeout=475200
{{- end }}
[init]
defaultBranch = master
templatedir = ~/.git-templates/git-secrets
[tag]
sort = -version:refname
[commit]
verbose = true
{{- if $isWindows }}
# =============================================================================
# Windows-specific Configuration
# =============================================================================
[alias]
ls = "ls-files"
graph = "log --graph"
empty = "commit --allow-empty -nm"
commitn = "commit -nm"
commitan = "commit -anm"
amecomi = "commit --amend"
amecomin = "commit --amend --no-verify"
namecomi = "commit --amend --no-edit"
namecomin = "commit --amend --no-edit --no-verify"
cleanfetch = "fetch --all --prune --tags --prune-tags"
hash = "log --format=%H | sed -n 1p"
shallow-clone = "clone --depth 1"
file-diff = "diff --name-only"
staged = "diff --cached"
[winUpdater]
recentlySeenVersion = 2.25.0.windows.1
[credential "helperselector"]
selected = manager
[credential "https://codeberg.org"]
provider = generic
{{- end }}
# =============================================================================
# Delta Configuration
# =============================================================================
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[delta]
plus-style = "syntax #012800"
minus-style = "syntax #340001"
syntax-theme = Monokai Extended
navigate = true
[interactive]
diffFilter = delta --color-only
# =============================================================================
# git hooks (by hk.jdx.dev)
# =============================================================================
[hook "hk-commit-msg"]
command = test \"${HK:-1}\" = \"0\" || hk run commit-msg --from-hook \"$@\"
event = commit-msg
[hook "hk-post-checkout"]
command = test \"${HK:-1}\" = \"0\" || hk run post-checkout --from-hook \"$@\"
event = post-checkout
[hook "hk-post-commit"]
command = test \"${HK:-1}\" = \"0\" || hk run post-commit --from-hook \"$@\"
event = post-commit
[hook "hk-post-merge"]
command = test \"${HK:-1}\" = \"0\" || hk run post-merge --from-hook \"$@\"
event = post-merge
[hook "hk-post-rewrite"]
command = test \"${HK:-1}\" = \"0\" || hk run post-rewrite --from-hook \"$@\"
event = post-rewrite
[hook "hk-pre-commit"]
command = test \"${HK:-1}\" = \"0\" || hk run pre-commit --from-hook \"$@\"
event = pre-commit
[hook "hk-pre-push"]
command = test \"${HK:-1}\" = \"0\" || hk run pre-push --from-hook \"$@\"
event = pre-push
[hook "hk-pre-rebase"]
command = test \"${HK:-1}\" = \"0\" || hk run pre-rebase --from-hook \"$@\"
event = pre-rebase
[hook "hk-prepare-commit-msg"]
command = test \"${HK:-1}\" = \"0\" || hk run prepare-commit-msg --from-hook \"$@\"
event = prepare-commit-msg
# =============================================================================
# git-ai
# =============================================================================
[trace2]
eventTarget = af_unix:stream:/home/mimikun/.git-ai/internal/daemon/trace2.sock
eventNesting = 10
# =============================================================================
# Conditional Includes
# =============================================================================
{{- if $isWorkPC }}
# Work PC: Only anonymize codeberg.org/mimikun
[includeIf "gitdir:~/ghq/codeberg.org/mimikun/"]
path = ~/.gitconfig.d/secret.inc
{{- end }}