-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
185 lines (165 loc) · 7.51 KB
/
.gitconfig
File metadata and controls
185 lines (165 loc) · 7.51 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
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
[alias]
# Help conforming to git-enforced whitespace rules:
# =================================================
#
# If you have the default .git/hooks/pre-commit enabled, then git will prevent you from having
# most of the wasteful (and in the case of languages that are whitespace sensitive like python
# or TCL or makefiles, potentially errorprone) whitespace in your changesets. It is possible
# to configure most editors to avoid adding this whitespace but:
# * I don't want whitespace I didn't add hilighted red in all of the code I read
# * I don't want to re-implement the whitespace rules and git diffing to know which whitespace I added
# * git already knows how to fix whitespace but the fixing code is in 'git apply' and that
# only helps you if you actually use a patch-oriented workflow
#
# From http://gitster.livejournal.com/45019.html with the following mods:
# git executes aliases in the root of the working directory, so it doesn't work if you give it
# relative paths to files you want to add.... grrr
# However, GIT_PREFIX is set so that you can cd back to it. double grrr.
# Finally, if you actually do run the command at the toplevel $GIT_PREFIX is set to "" emptystring. triple grrr.
#
# the (git diff --exit-code --no-ext-diff -- \"$@\" && git diff --no-ext-diff -- /dev/null \"$@\")
# part is there to handle the case where the file hasn't been added to the index yet.
# However, this solution conflicts with the case where there really aren't any differences
# to add. Need to do a better lookup to see if the file is already in the index. If it
# is, then do what I currently have as the alias but only do the checkout if the apply was
# successful, else you have to do the diff against /dev/null to add the file for the first
# time into the index. Note, that this is further complicated by the fact that diffing
# against /dev/null can't be done for multiple files at once the way I'm currently calling
# it. Would be better if there was just an option to diff that would treat files that
# aren't in the index as empty if you explicitly ask for them to be diffed on the cmdline
# (possibly with a warning to STDERR).
#
# The way to fix this might be to look for all names in the index, For any not there, then put
# /dev/null into the index as those names, then retry.
#
# Actually, do this. First, do 'git add -N "$@"' to add all files to the index with no
# content then actually do the add
#
wsadd = "!sh -xc 'test -n \"$GIT_PREFIX\" && cd $GIT_PREFIX; git add -N \"$@\" && git diff --no-ext-diff -- \"$@\" | git apply --cached --whitespace=fix && git checkout -- ${1-.} \"$@\"' -"
# do wsadd on all modified files
wsaddm = "!git status --short | grep '^ M' | awk '{print $2}' | xargs git wsadd"
# list unique authors
# NOTE: log inside an alias doesn't map relative filesystem paths to git-tree root relative paths
# and the alias is envoked at the top of the git repo. that's why we need to cd back into
# $GIT_PREFIX before running the command
acpairs = "!sh -c 'test -n \"$GIT_PREFIX\" && cd $GIT_PREFIX; git log --format=\"format:%aN<%aE>, %cN<%cE>,\" -- \"$@\" | sort -u' -"
authors = "!sh -c 'test -n \"$GIT_PREFIX\" && cd $GIT_PREFIX; git log --format=\"format:%aN<%aE>,\" -- \"$@\" | sort | uniq -c' -"
committers = "!sh -c 'test -n \"$GIT_PREFIX\" && cd $GIT_PREFIX; git log --format=\"format:%cN<%cE>,\" -- \"$@\" | sort | uniq -c' -"
# shorthand for 'git gui blame HEAD <whatever>'
gb = gui blame HEAD
# Variations on showing you what's coming in and going out
# only useful when workign with a branch that has '@{upstream}' defined
gin = !git fetch && gitk $(git merge-base @{u} HEAD)~..@{u}
gout = !git fetch && gitk @{u}~..HEAD
in = !git fetch && git log --abbrev=9 --format=short ..@{u}
out = !git fetch && git log --abbrev=9 --format=short @{u}..
# Show a text based graphical log
lol = log --pretty=oneline --abbrev-commit --graph --decorate --cc
co = checkout
d = describe
st = status
stat = status
ss = status -sb
sb = show-branch
di = diff-index -p --cached
ws = diff-index --check --cached HEAD
sm = submodule
dsm = !git --no-pager diff --submodule=log
smfe = submodule foreach
smfer= submodule foreach --recursive
rc = rebase --continue
mt = mergetool
dt = mergetool
dd = difftool -d --tool gvimdiffdir
# interactive clean through all submodules
ic = "!git clean -Xdi; git smfer git clean -Xdi"
# dry-run clean through all submodules
cn = "!git clean -Xdn; git smfer git clean -Xdn"
# just give me the short version of the sha I have checked out, sheesh.
head = rev-parse --short HEAD
# describe options useful for an important repo
fd = describe --tags --match *-general --match *-preview --match sparta.firesim* --dirty --broken
[advice]
detachedHead = false
[diff]
tool = gvimdiff
# detect renames and file copies instead of reporting whole file chunks
renames = copies
submodule = log
[difftool]
prompt = false
[difftool.kccmp]
cmd = kccmp $LOCAL $MERGED
[difftool.gvimdiffdir]
# dirdiff seems to only give one path, $LOCAL.
# $MERGED seems to be undef when called with -d
cmd = gvim -f '+execute \"DirDiff\" fnameescape(argv(0)) fnameescape(fnamemodify(argv(0),\":h\").\"/right\")' $LOCAL
[merge]
tool = gvimdiff
defaultToUpstream = true
[mergetool]
prompt = false
[log]
# this breaks sim
# abbrevCommit = true # added between 1.7.3.4 and 1.7.11.4
[color]
ui = auto
[user]
name = Tim Snyder
email = snyder.tim@gmail.com
[credential]
helper = cache
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
smAhead = green
smPush = green
[branch]
autosetuprebase = always
[core]
sharedRepository = 0x664
# This breaks sim
abbrev = 9
excludesfile = ~/.gitignore
# warning: push.default is unset; its implicit value is changing in
# Git 2.0 from 'matching' to 'simple'. To squelch this message
# and maintain the current behavior after the default changes, use:
#
# git config --global push.default matching
#
# To squelch this message and adopt the new behavior now, use:
#
# git config --global push.default simple
#
# See 'git help config' and search for 'push.default' for further information.
# (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
# 'current' instead of 'simple' if you sometimes use older versions of Git)
# switched back to current for now because older versions of git don't have simple
# and having this in the global config breaks my zsh prompt stuff
[push]
default = simple
[fetch]
# 0 picks some reasonable default
# aka online_cores https://github.com/git/git/blob/27d43aaaf50ef0ae014b88bba294f93658016a2e/builtin/fetch.c#L2206-L2207
parallel=0
[rebase]
autoSquash = true
[url "https://github.com/davea42/libdwarf-code.git"]
insteadOf = git://git.code.sf.net/p/libdwarf/code
[url "https://github.com"]
insteadOf = git://github.com
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true