|
12 | 12 | # c.f. https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
|
13 | 13 | longpaths = true
|
14 | 14 |
|
15 |
| -[help] |
16 |
| - autocorrect = 1 |
17 |
| - |
18 | 15 | [color]
|
19 | 16 | diff = auto
|
20 | 17 | status = auto
|
|
38 | 35 | [lfs]
|
39 | 36 | batch = true
|
40 | 37 | ConcurrentTransfers = 10
|
| 38 | +# If the Git LFS locking feature is used, then Git LFS will set lockable files |
| 39 | +# to "readonly" by default. This is implemented with a Git LFS "post-checkout" |
| 40 | +# hook. Git LFS can skip this hook if no file is locked. However, Git LFS needs |
| 41 | +# to traverse the entire tree to find all ".gitattributes" and check for locked |
| 42 | +# files. In a large tree (e.g. >20k directories, >300k files) this can take a |
| 43 | +# while. Instruct Git LFS to not set lockable files to "readonly". This skips |
| 44 | +# the "post-checkout" entirely and speeds up Git LFS for large repositories. |
| 45 | + SetLockableReadonly = false |
41 | 46 |
|
42 | 47 | [lfs "transfer"]
|
43 | 48 | maxretries = 10
|
|
48 | 53 | process = git-lfs filter-process
|
49 | 54 | required = true
|
50 | 55 |
|
| 56 | +[lfs "https://git.company.com/"] |
| 57 | + locksverify = true |
| 58 | + |
| 59 | + |
| 60 | +############################################################################### |
| 61 | +# Use HTTPS protocol instead of Git protocol |
| 62 | +############################################################################### |
| 63 | +[url "https://git.company.com/"] |
| 64 | + insteadOf = "git://git.company.com/" |
| 65 | + pushInsteadOf = "git://git.company.com/" |
| 66 | + |
51 | 67 |
|
52 | 68 | ###############################################################################
|
53 | 69 | # Configure push protection to public Git hosting services
|
|
69 | 85 | st=status
|
70 | 86 | br=branch
|
71 | 87 | lol = "log --pretty=oneline --abbrev-commit --graph --decorate"
|
| 88 | + lola = "log --pretty=oneline --abbrev-commit --graph --decorate --all" |
72 | 89 | prlog = "log --pretty=oneline --abbrev-commit --graph --decorate --first-parent"
|
73 | 90 |
|
74 | 91 |
|
75 | 92 | ###############################################################################
|
76 | 93 | # Enterprise Config setup command
|
77 | 94 | ###############################################################################
|
78 |
| - adsk = "!f() { \ |
79 |
| - KIT_PATH=$(dirname \"$(git config include.path)\") && \ |
80 |
| - ENV=$(git config adsk.environment || true) && \ |
81 |
| - COMMAND=$1 && \ |
82 |
| - if [ -n \"$COMMAND\" ]; then \ |
83 |
| - shift 1; \ |
84 |
| - fi && \ |
85 |
| - if [ -z \"$COMMAND\" ] || [ \"$COMMAND\" = \"setup\" ]; then \ |
86 |
| - TMP_SETUP=$(mktemp -t git-enterprise-kit.XXXXXX) && \ |
87 |
| - cp \"$KIT_PATH/setup.sh\" \"$TMP_SETUP\" && \ |
88 |
| - bash \"$TMP_SETUP\" \"$KIT_PATH\" \"$@\" && \ |
89 |
| - rm \"$TMP_SETUP\"; \ |
90 |
| - elif [ \"$COMMAND\" = \"install\" ]; then \ |
91 |
| - echo \"Enterprise config already installed!\"; \ |
92 |
| - elif [ -n \"$ENV\" ] && [ -e "$KIT_PATH/envs/$ENV/$COMMAND.sh" ]; then \ |
93 |
| - bash \"$KIT_PATH/envs/$ENV/$COMMAND.sh\" \"$@\"; \ |
94 |
| - elif [ -e \"$KIT_PATH/$COMMAND.sh\" ]; then \ |
95 |
| - bash \"$KIT_PATH/$COMMAND.sh\" \"$@\"; \ |
96 |
| - else \ |
97 |
| - echo \"Enterprise Config command '$COMMAND' not found.\"; \ |
98 |
| - fi \ |
99 |
| - }; f" |
| 95 | +# |
| 96 | +# Jenkins Git Plugin 3.4.1 cannot handle mutplie lines in config files. |
| 97 | +# Therefore, we have to reformat the code below into the one line. |
| 98 | +# |
| 99 | +# adsk = "!f() { \ |
| 100 | +# KIT_PATH=$(dirname \"$(git config include.path)\") && \ |
| 101 | +# ENV=$(git config adsk.environment || true) && \ |
| 102 | +# COMMAND=$1 && \ |
| 103 | +# if [ -n \"$COMMAND\" ]; then \ |
| 104 | +# shift 1; \ |
| 105 | +# fi && \ |
| 106 | +# if [ \"$KIT_PATH\" = \"adsk-git\" ]; then \ |
| 107 | +# case $(uname -s) in \ |
| 108 | +# MINGW32_NT*) KIT_PATH=/mingw32/etc/adsk-git;; \ |
| 109 | +# MINGW64_NT*) KIT_PATH=/mingw64/etc/adsk-git;; \ |
| 110 | +# esac \ |
| 111 | +# fi && \ |
| 112 | +# if [ -z \"$COMMAND\" ] || [ \"$COMMAND\" = \"setup\" ]; then \ |
| 113 | +# TMP_SETUP=$(mktemp -t git-enterprise-kit.XXXXXX) && \ |
| 114 | +# cp \"$KIT_PATH/setup.sh\" \"$TMP_SETUP\" && \ |
| 115 | +# bash \"$TMP_SETUP\" \"$KIT_PATH\" \"$@\" && \ |
| 116 | +# rm \"$TMP_SETUP\"; \ |
| 117 | +# elif [ \"$COMMAND\" = \"install\" ]; then \ |
| 118 | +# echo \"Enterprise config already installed!\"; \ |
| 119 | +# elif [ -n \"$ENV\" ] && [ -e "$KIT_PATH/envs/$ENV/$COMMAND.sh" ]; then \ |
| 120 | +# bash \"$KIT_PATH/envs/$ENV/$COMMAND.sh\" \"$@\"; \ |
| 121 | +# elif [ -e \"$KIT_PATH/$COMMAND.sh\" ]; then \ |
| 122 | +# bash \"$KIT_PATH/$COMMAND.sh\" \"$@\"; \ |
| 123 | +# else \ |
| 124 | +# echo \"Enterprise Config command '$COMMAND' not found. Please contact [email protected] or the #tech-git Slack channel.\"; \ |
| 125 | +# fi \ |
| 126 | +# }; f" |
| 127 | + adsk = "!f() { KIT_PATH=$(dirname \"$(git config include.path)\") && ENV=$(git config adsk.environment || true) && COMMAND=$1 && if [ -n \"$COMMAND\" ]; then shift 1; fi && if [ \"$KIT_PATH\" = \"adsk-git\" ]; then case $(uname -s) in MINGW32_NT*) KIT_PATH=/mingw32/etc/adsk-git;; MINGW64_NT*) KIT_PATH=/mingw64/etc/adsk-git;; esac fi && if [ -z \"$COMMAND\" ] || [ \"$COMMAND\" = \"setup\" ]; then TMP_SETUP=$(mktemp -t git-enterprise-kit.XXXXXX) && cp \"$KIT_PATH/setup.sh\" \"$TMP_SETUP\" && bash \"$TMP_SETUP\" \"$KIT_PATH\" \"$@\" && rm \"$TMP_SETUP\"; elif [ \"$COMMAND\" = \"install\" ]; then echo \"Enterprise config already installed!\"; elif [ -n \"$ENV\" ] && [ -e "$KIT_PATH/envs/$ENV/$COMMAND.sh" ]; then bash \"$KIT_PATH/envs/$ENV/$COMMAND.sh\" \"$@\"; elif [ -e \"$KIT_PATH/$COMMAND.sh\" ]; then bash \"$KIT_PATH/$COMMAND.sh\" \"$@\"; else echo \"Enterprise Config command '$COMMAND' not found. Please contact [email protected] or the #tech-git Slack channel.\"; fi }; f" |
| 128 | + |
| 129 | + |
| 130 | +############################################################################### |
| 131 | +# hub command-line wrapper https://hub.github.com/ |
| 132 | +############################################################################### |
| 133 | +[hub] |
| 134 | + host = git.company.com |
| 135 | + protocol = https |
100 | 136 |
|
101 | 137 |
|
102 | 138 | ###############################################################################
|
|
105 | 141 | [ghfw]
|
106 | 142 | disableverification = true
|
107 | 143 |
|
| 144 | + |
108 | 145 | ###############################################################################
|
109 | 146 | # More helpful diff'ing of one line JSON files
|
110 | 147 | ###############################################################################
|
111 | 148 | [diff "json"]
|
112 |
| - textconv = "perl -MJSON::PP -e '$j = JSON::PP->new->pretty->canonical; print $j->encode($j->decode(<>))'" |
| 149 | + textconv = "perl -MJSON::PP -e '$j = JSON::PP->new->pretty->canonical; print $j->encode($j->decode(do {$/ = undef; <>}))'" |
113 | 150 | cachetextconv = true
|
| 151 | + |
| 152 | + |
| 153 | +############################################################################### |
| 154 | +# Define a merge driver that won't actually merge a file... for those files |
| 155 | +# which must never be merged. |
| 156 | +# |
| 157 | +# Example content of .gitattributes file: |
| 158 | +# branchinfo.txt merge=ours |
| 159 | +# /environment-config/* merge=ours |
| 160 | +# |
| 161 | +# Further information: |
| 162 | +# https://medium.com/@porteneuve/how-to-make-git-preserve-specific-files-while-merging-18c92343826b |
| 163 | +############################################################################### |
| 164 | +[merge "ours"] |
| 165 | + driver = true |
0 commit comments