-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
213 lines (199 loc) · 5.47 KB
/
.gitconfig
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Important stuff
[user]
name = Alhadis
email = [email protected]
signingkey = 29ADC0C5D992F678
[core]
autocrlf = false
excludesfile = ~/.files/etc/.global.gitignore
attributesfile = ~/.files/etc/.global.gitattributes
whitespace = -blank-at-eol
ignorecase = false
untrackedCache = true
[credential]
helper = osxkeychain
[github]
user = Alhadis
[gpg]
program = gpg2
# Porcelain configuration
[color]
pager = false
[diff]
renames = copies
[help]
autocorrect = never
[init]
defaultBranch = master
[pager]
show = format-diff
diff = format-diff
[pull]
rebase = false
[stash]
showIncludeUntracked = true
showPatch = true
[versionsort]
suffix = -alpha
suffix = -beta
suffix = -rc
# User-defined git(1) subcommands
[alias]
# Rarely-used shorthands
co = checkout
r = remote --verbose
s = status
# Manipulate history of local checkout
undo = reset --soft HEAD~1
rewind = reset --hard
# Resolve project's root directory
root = rev-parse --show-toplevel
parent = rev-parse --show-superproject-working-tree
# Print the default branch-name used by remote
default-branch = "! { \
remote=`git remote`; \
branch=`git symbolic-ref -q --short \"refs/remotes/$remote/HEAD\"`; \
printf '%s\n' \"${branch#\"$remote/\"}\"; \
};"
# Print the object-ID of the branch's last commit
latest-hash = show --no-patch --format=%H
# Print the name of the most recently-tagged release
latest-tag = for-each-ref \
--merged=HEAD \
--count=1 \
--ignore-case \
--sort='-*creatordate' \
--format='%(refname:lstrip=-1)' \
refs/tags
# Print only the useful parts of git-check-attr(1) output
attr-names = "! git check-attr --all -z \"$1\" | xargs -0n3 /bin/sh -c 'echo $1' | sort #"
attr-value = "! { \
value=`git check-attr -z \"$1\" -- \"$2\" | tr '\\0' '\\t' | cut -f3`; \
case $value in unspecified) git attr-names \"$2\" | grep -Fqx \"$1\" || exit 1;; esac; \
printf '%s\\n' \"$value\"; \
}; #"
# Diff drivers for binary file formats
[diff "7z"]
textconv = 7z l -slt
[diff "asar"]
textconv = file -b \"$1\" && asar list
[diff "bin"]
textconv = hexdump -v -C
[diff "bzip"]
textconv = bunzip2 -kc
[diff "db"]
algorithm = minimal
textconv = "sqlite3 \"$1\" .dump | unexpand -at2;:"
xfuncname = "^CREATE( TEMP(ORARY)?| VIRTUAL)? TABLE( IF NOT EXISTS)? ([A-Za-z0-9]+)\\b"
binary = true
[diff "db?"]
cachetextconv = false
textconv = \
"case `file --brief --mime-type \"$1\"` in \
application/vnd.sqlite3) exec git diff.run db \"$1\";; \
application/octet-stream) exec git diff.run bin \"$1\";; \
esac; cat"
[diff "deb"]
textconv = \
dpkg-deb --info \"$1\" && \
echo && (dpkg-deb --ctrl-tarfile \"$1\" | tar tvf -) && \
echo && dpkg-deb --contents
[diff "dmg"]
textconv = hdiutil imageinfo
[diff "doc"]
textconv = antiword -rsft
[diff "docx"]
textconv = docx2txt.pl - /dev/stdout <
[diff "dyld"]
textconv = dyld_info -platform -segments -dependents -objc -inits -exports -fixups
[diff "exif"]
textconv = exiftool -a -U -x FileName -x Directory
[diff "gzip"]
textconv = gzinfo -v
[diff "lz4"]
textconv = lz4 -dcfm
[diff "lzma"]
textconv = lzmainfo \"$1\" && unlzma -c
[diff "mkv"]
textconv = ffprobe
cachetextconv = true
[diff "odt"]
textconv = odt2txt
[diff "pdf"]
textconv = pdftotext -htmlmeta -layout - - <
binary = true
[diff "plist"]
textconv = convert-plist
binary = true
[diff "ps"]
textconv = ps2ascii
binary = true
[diff "rar"]
textconv = unrar v -vy
[diff "sym"]
textconv = nm -aCp
[diff "sz"]
textconv = snzip -dc
[diff "tar"]
textconv = tar tvvzf \"$1\" && file -b
[diff "tar,bzip"]
textconv = git diff.tarball bzip
[diff "tar,gzip"]
textconv = git diff.tarball 'gunzip -kc'
[diff "tar,lz4"]
textconv = git diff.tarball lz4
[diff "tar,lzma"]
textconv = git diff.tarball 'unlzma -c'
[diff "tar,sz"]
textconv = git diff.tarball sz
[diff "tar,xz"]
textconv = git diff.run xz \"$1\" && echo && (unxz | tar tvf -) <
[diff "tar,z"]
textconv = tar tvvzf
[diff "tar,zstd"]
textconv = zstd -lv \"$1\" 2>&1 | tar tvf - && file -b
[diff "xar"]
textconv = xarinfo
[diff "xz"]
textconv = xz -lvv
[diff "z"]
textconv = uncompress -c
[diff "zip"]
textconv = zipinfo -l \"$1\" && (zipinfo -v \"$1\" | sed 1d) <
[diff "zstd"]
textconv = zstd -lv \"$1\" 2>&1 | sed 1d && zstd -dcf <
# Subcommands for debugging git-diff(1) drivers
[alias.diff]
# List configured diff-drivers
drivers = ! git config --list --name-only | sed -En \
-e 's/[.]command$/.textconv/' \
-e 's/^diff[.]([^.]+)[.]textconv$/\\1/p'
# Purge cached diff-driver output
flush = ! git -c core.logAllRefUpdates=false \
for-each-ref --format='%(refname) %(objectname)' refs/notes/textconv/ \
| xargs -n2 git update-ref -d
# Perform text-conversion upon an arbitrary file
run = "! f(){ \
die(){ printf \"$@\" >&2; echo; exit 2; }; \
expect_file(){ test -f \"$1\" || die 'No such file: “%s”' \"$1\"; }; \
case $# in \
0) die 'Usage: git diff.run [diff-type] [file]';; \
1) expect_file \"$1\"; set -- \"`git attr-value diff \"$1\"`\" \"$1\";; \
*) expect_file \"$2\";; \
esac; \
test -n \"$1\" || die 'No driver defined for file “%s”' \"$2\"; \
cmd=`git config diff.\"$1\".textconv`; \
test -n \"$cmd\" || die 'No such driver: %s' \"$1\"; \
shift; eval \"$cmd\" \"$1\"; \
}; f"
# Decompress tarball using the named diff-driver
tarball = "! case $1 in \
*' '*) $1 \"$2\";; \
*) git diff.run \"$1\" \"$2\";; \
esac | tar tvf - && file -b \"$2\";:"
# Filter drivers
[filter "lfs"]
process = git-lfs filter-process
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true