-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
67 lines (57 loc) · 3.82 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
[user]
name = Erik Peterson
email = [email protected]
[core]
excludesfile = /Users/erik.peterson/.gitignore_global
pager = /usr/bin/less -+$LESS -FRX
[uploadArchive]
allowUnreachable = true
[color]
ui = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[push]
default = matching
[alias]
la = "!git config -l | grep alias | cut -c 7-"
graph = log --all --graph --decorate --oneline -n30
le = log --oneline --decorate
sync = "!f() { git checkout master && git fetch --all && git rebase upstream/master && git push -f origin master; }; f"
# Return commit messages for the current tag
merges = "!f() { git log --oneline --merges --simplify-merges --pretty=format:\"%B\" $(git ahtag)..master | egrep -v '(^Merge|^$)' | sed -e 's/^/ * /'; }; f"
# Return a list of contributors
contribs = "!f() { git log --oneline --no-merges --pretty=format:\"%an\" $(git ahtag)..master | sort -u | awk '{print}' ORS='++ ' | sed -e 's/^/Contributions by: /'; }; f"
# Get the remote name of the acquia/support-cli upstream repo
ahremote = "!f() { git remote -v | grep -m 1 \"acquia/support-cli\" | cut -f1 ; }; f"
# Construct nicely formatted release notes
prnotes2 = "!f() { echo 'This release:' ; git merges ; echo; git contribs ; echo; git ahtag; }; f"
# Get the most recent tag
ahtag = "!f() { git ls-remote --tags $(git ahremote) release-* | cut -f2 | sort | tail -n1 ; }; f"
# Create a tagged release and push to the upstream repo
prod-release = "!f() { ACQUIA_REMOTE=$(git remote -v | grep -m 1 \"[email protected]:acquia/support-cli.git (push)\" | cut -f1) && RELEASE_TAG=$(date -u +release-%F-%H-%M) && git tag -a ${RELEASE_TAG} && git push ${ACQUIA_REMOTE} ${RELEASE_TAG} && git --no-pager log --pretty=format:\"%n%C(yellow)%h%Creset %s%Cblue [%an]%n %Cred%d%Creset%n\" --decorate -1; }; f"
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=relative
le = log --oneline --decorate
trim = "!f() { for GIT_TRIM_BRANCH in $(git branch --merged | egrep -v \"(\\* | master$)\" ); do git branch -d \"$GIT_TRIM_BRANCH\"; done; }; f"
acquia-github-remote = "!f() { git remote -v | grep -m 1 \"github.com:acquia/\" | cut -f1 ; }; f"
last-release = "!f() { git ls-remote --tags $(git acquia-github-remote) release-* supportcomm-release-* 201?-??-??* v?.*.* v??.*.* | cut -f2 | sort | tail -n1 ; }; f"
release-contribs = "!f() { git log --oneline --no-merges --pretty=format:\"%an\" $(git last-release)..master | sort -u | awk '{print}' ORS=', ' | sed -e 's/..$//' ; }; f"
release-commits = "!f() { git log --oneline --no-merges --pretty=format:\"%s\" $(git last-release)..master | sed -e 's/^/ * /'; }; f"
release-tickets = "!f() { git release-commits | grep -Eo '[A-Z]+-[0-9]+' | xargs | sed -e 's# #%2C#g;s#^#https://backlog.acquia.com/issues/?jql=key%20in%20(#;s#$#)#'; }; f"
release-notes = "!f() { echo 'This release includes the following contributions by '$(git release-contribs)':' ; git release-commits ; echo; echo 'View in JIRA: ' $(git release-tickets) ; echo ; echo '[Previous release:' $(git last-release)']' ; echo ; }; f"
[hub]
protocol = git
[pager]
log = `brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | /usr/bin/less -+$LESS -FRX
diff = `brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | /usr/bin/less -+$LESS -FRX
show = `brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | /usr/bin/less -+$LESS -FRX
[github]
user = eporama
[pull]
rebase = false
[init]
defaultBranch = main