-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig.symlink
79 lines (67 loc) · 3.01 KB
/
.gitconfig.symlink
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
[user]
name = Conrad Dean
email = [email protected]
username = cpdean
[credential]
helper = "cache --timeout=3600"
[branch]
# autosetuprebase = always # actually, not sure about rebasing. it will modify your history
autosetupmerge = always # auto track things when i make new branches
[push]
default = current
[core]
ignorecase = false
autocrlf = input
excludesfile = ~/.dotfiles/gitignore_global
[alias]
shame = '!s() { git blame -p $@ | sed -n "s/^author-mail //p" | head -n 1; }; s'
whatwas = "log --follow -p --"
# prints a concise report about when, who, and what happened
story= "log --format=\"%Cgreen %h%Creset %<(19,trunc)%ae %Cgreen%as%Creset %s\""
# from https://blog.jez.io/cli-code-review/
# list files which have changed since REVIEW_BASE
# (REVIEW_BASE defaults to 'master' in bashrc)
jezfiles = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\")
# better
files = !git diff --name-only $(git merge-base HEAD $(git trunk))
# from https://blog.jez.io/cli-code-review/
# Same as above, but with a diff stat instead of just names
# (better for interactive use)
jezstat = !git diff --stat $(git merge-base HEAD \"$REVIEW_BASE\")
# better
#stat = !git diff --stat $(git merge-base HEAD \"${@:-master}\")
# best
stat = !git diff --stat $(git merge-base head $(git trunk))
pr-diff = !git diff $(git merge-base head $(git trunk))
# from https://blog.jez.io/cli-code-review/
# Open all files changed since REVIEW_BASE in Vim tabs
# Then, run fugitive's :Gdiff in each tab, and finally
# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
review = !nvim -p $(git files) +\"tabdo Gvdiffsplit $(git trunk)\" +\"let g:gitgutter_diff_base = '$(git trunk)'\"
# from https://blog.jez.io/cli-code-review/
# Same as the above, except specify names of files as arguments,
# instead of opening all files:
# git reviewone foo.js bar.js
reviewone = !nvim -p +\"tabdo Gvdiffsplit $(git trunk)\" +\"let g:gitgutter_diff_base = '$(git trunk)'\"
# alias for the alias
ro = reviewone
# show PR picker to select a PR for review
pr = !gh pr checkout $(gh pr list | fzf --height=10 --reverse | awk '{print $1}')
# show the history of ci runs for the branch we are on
show-ci = !gh run list -b $(git branch --show-current)
open-ci = !gh run view --web $(gh run list -b $(git branch --show-current) --json createdAt,displayTitle,status,databaseId --template '{{range .}}{{tablerow .databaseId .createdAt .status .displayTitle}}{{end}}' | fzf --height=15 | awk '{ print $1 }')
# different repos have different trunks
trunk = rev-parse --abbrev-ref origin/HEAD
[includeIf "gitdir:~/dev/work/"]
path = .gitconfig-work
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
ff = only
#[url "ssh://[email protected]/"]
# insteadOf = https://github.com/
[init]
defaultBranch = main