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
|
There are two ways of changing git configuration options
1) using "git config" to change the current repository's configuration, and
"git config --global" to change global configuration.
2) Editing $GIT_TOPDIR/.git/config (.git can be found with "git rev-parse
--git-dir") to change the current repository's configuration, and editing
~/.gitconfig for the global configuration.
You can list all currently set configuration options with "git var -l".
------------------------
Config options which should be set for the Crawl repository, but probably
shouldn't be global config options:
* Always rebase when doing a pull:
git config branch.master.rebase true
* Always rebase when setting up a new branch:
git config branch.autosetuprebase always
* Don't translate line endings to the native format. Necessary for
Visual Studio projects:
git config core.autocrlf false
------------------------
Some useful config options:
* Automatically colour all output which can be coloured:
git config --global color.ui auto
* Automatically fix whitespace problems in a patch if using the
"apply" command:
git config --global apply.whitespace fix
* Use more than one thread for packing when doing a push or gc.
Useful on multi-processor or dual-core machines:
git config --global pack.threads 2
-------------------------
Install a pre-commit sanity check
From the root of the git tree type:
cp crawl-ref/docs/develop/git/pre-commit .git/hooks
-------------------------
Nice hunk markers for .des files:
Add this to .git/config:
[diff "des"]
xfuncname = ".*\\{\\{.*"
xfuncname = "^NAME:.*$"
Combined with the *.des entry in crawl-ref/.gitattributes, this will
cause "git diff" to include helpful headers in each hunk (after the
second @@), like so:
--- a/crawl-ref/source/dat/des/builder/uniques.des
+++ b/crawl-ref/source/dat/des/builder/uniques.des
@@ -405,8 +405,8 @@ NAME: uniq_crazy_yiuf_cottage
SUBST: P:PQ;; , Q=2;
NSUBST: P=1:t / *:2;
# Randomisation 4: Hammers. Hammers. Hammers.
-SUBST: ; : .:100 ;:10 2:d
-SUBST: ; = .:10 2:d
+SUBST: ; : .:100 ;:10 d:2
+SUBST: ; = .:10 d:2
: if crawl.one_chance_in(300) then
SUBST: t="
: end
|