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
# Create environments for developing Git Cola against development versions of Git.
#
# The following gardens are defined: "cola", "cola/main" and "cola/next".
#
# The "cola" garden runs git-cola using the "git" command from your $PATH.
# The "cola/main" garden runs git-cola using git.git's "main" branch.
# The "cola/next" garden runs git-cola using git.git's "next" branch.
#
# One-time Setup:
#
# * Clone repositories and create worktrees:
#
# garden grow cola/main cola/next
#
# * Initialize git-cola's Python virtualenv environment.
#
# garden setup cola
#
# Development workflows:
#
# * Build the "cola/main" garden using git.git's "main" branch:
# garden build cola/main
#
# * Build the "cola/next" garden using git.git's "next" branch:
# garden build cola/next
#
# * Run Git Cola
# garden run
#
# * Run Git Cola on the git/next and git-cola trees using the cola/next garden environment:
# garden run --trees git/next cola/next
# garden run -t git-cola cola/next
#
# * Open a shell for running Git Cola in different enviornments
# garden shell cola/main
# garden shell cola/next
#
# * Run just Git Cola's tests in each environment.
# garden test/cola cola
# garden test/cola cola/main
# garden test/cola cola/next
#
# * Run tests for all projects in each environment. Also runs Git's testsuite.
# garden test cola
# garden test cola/main
# garden test cola/next
# The following variables are used in the custom commands below.
variables:
# A virtualenv is created in the ./dist/git-cola/env3 directory.
prefix: ${GARDEN_ROOT}/git-cola/env3
jobs: $ nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 8
commands:
add-all: git add --update
diff: GIT_PAGER= git diff --patience --color-words "$@"
lol: git log --decorate --graph --oneline "$@" && echo
run: vx ${prefix} git cola "$@"
status:
- git status --short
- git branch
templates:
bin:
environment:
PATH: ${TREE_PATH}/bin
python:
environment:
PYTHONPATH: ${TREE_PATH}
makefile:
commands:
build: make -j ${jobs} prefix="${prefix}" all "$@"
install: make -j ${jobs} prefix="${prefix}" install "$@"
test: make -j ${jobs} prefix="${prefix}" test "$@"
doc: make -j ${jobs} prefix="${prefix}" doc "$@"
trees:
# git/main is the parent worktree that shares its .git storage with the child
# git/next worktrees using "git worktree" -- https://git-scm.com/docs/git-worktree
git/main:
url: https://github.com/git/git.git
templates: makefile
environment:
PATH: ${TREE_PATH}/bin-wrappers
# git/next is a "git worktree" for git.git's "next" branch.
git/next:
worktree: git/main
branch: next
# git-cola's worktree can be reused alongside any of the git/* trees defined above.
git-cola:
url: https://gitlab.com/git-cola/git-cola.git
templates:
commands:
setup: garden dev
test/cola: garden test "$@"
install: garden -D prefix="${prefix}" install "$@"
test: garden test "$@"
doc: garden doc "$@"
qtpy:
description: Qt abstraction library used by git-cola
url: https://github.com/spyder-ide/qtpy.git
templates: python
setup: vx ${prefix} pip install pytest-qt
vx:
description: Utility for activating Python virtualenvs
url: https://gitlab.com/davvid/vx.git
depth: 1 # Create a shallow clone using "git clone --depth=1"
environment:
PATH: ${TREE_PATH}
commands:
test: make test
# This tree allows the "run" command to be run from any directory.
cwd:
path: ${PWD}
groups:
cola-repos-grp:
- git-cola
- qtpy
- vx
gardens:
cola:
groups: cola-repos-grp
environment:
PATH: ${prefix}/bin
cola/main:
groups: cola-repos-grp
trees: git/main
environment:
PATH: ${prefix}/bin
cola/next:
groups: cola-repos-grp
trees: git/next
environment:
PATH: ${prefix}/bin