push: set the remote branch field when selecting a local branch
[git-cola.git] / garden.yaml
blob55d105b9fb61ea6566221751b070e7471e4c792a
1 # Use "cargo install garden-tools" to install garden https://gitlab.com/garden-rs/garden
3 #   # Installation
4 #   garden install              # Install git-cola to the installation ${prefix}
5 #   garden doc                  # Generate documentation: html + manual pages
6 #   garden install docs         # Install documentation
8 #   # Variables can be overridden using "-D name=value", e.g.:
9 #   garden -D prefix=$PWD/dist install docs
10 #   garden -D DESTDIR=/tmp/stage -D prefix=/usr/local install
12 #   # Development
13 #   garden test                 # Run the test suite
14 #   garden fmt                  # Format code using "cercis"
15 #   garden html                 # Generate documentation: html only
16 #   garden man                  # Generate documentation: manual pages only
17 #   garden pot                  # Regenerate git-cola.pot with new translations
18 #   garden po                   # Update .po files with new translations from git-cola.pot
19 #   garden pages                # Install the pages/ website documentation.
21 #   # macOS
22 #   garden macos/app            # Build a git-cola.app bundle
24 #   # Related Projects
25 #   garden grow pages           # Clone the Git Cola homepage
26 #   garden grow fedora          # Clone the Fedora packaging
27 #   garden grow deb             # Clone the Debian packaging
28 #   garden grow flatpak         # Clone the Flatpak packaging
29 trees:
30   git-cola:
31     description: The highly-caffeinated Git GUI
32     path: "${GARDEN_CONFIG_DIR}"
33     url: "git@gitlab.com:git-cola/git-cola.git"
34     commands:
35       clean: rm -rf build dist git-cola-*.windows.zip
36       doc: ${GARDEN} -vv cmd docs html man -- "$@"
37       dev: ${PYTHON} -m venv --system-site-packages ${env_dir}
38       dev>:
39         - dev/extras
40         - dev/development
41         - dev/build
42       dev/build: ${activate} ${PIP} install --editable '.[build]'
43       dev/development: ${activate} ${PIP} install --editable '.[docs,dev,testing]'
44       dev/extras: ${activate} ${PIP} install --editable '.[extras]'
45       dev/pyqt6: ${activate} ${PIP} install --editable '.[pyqt6]'
46       dev/env: ${activate} "$@"
47       check>:
48         - test
49         - check/fmt
50         - doc
51       check/fmt: garden fmt -- --check
52       fmt: |
53         ${activate}
54         ${CERCIS} --version
55         ${GIT} ls-files -- '*.py' |
56         ${GREP} -v ^qtpy |
57         ${XARGS} ${CERCIS} "$@"
58       html: ${GARDEN} -vv html docs
59       install: |
60         if test -n "${DESTDIR}"
61         then
62             pip_root="--root=${DESTDIR}"
63             export DESTDIR="${DESTDIR}"
64         fi
65         ${PIP} install --disable-pip-version-check $pip_root --prefix=${prefix} "$@" .
66       i18n>:
67         - pot
68         - po
69       macos/app: |
70         ${MKDIR_P} ${cola_app}/Contents/MacOS
71         ${MKDIR_P} ${cola_app_resources}
72         ${PYTHON} -m venv ${cola_app_resources}
73         source ${cola_app_resources}/bin/activate
74         ${PIP} install '.[docs,extras,pyqt6]'
75         ${CP} contrib/darwin/Info.plist contrib/darwin/PkgInfo ${cola_app}/Contents
76         if test -n "${cola_full_version}"
77         then
78             ${SED} -i -e s/0.0.0.0/${cola_full_version}/ ${cola_app}/Contents/Info.plist
79         fi
80         ${SED} -i -e s/0.0.0/${cola_version}/ ${cola_app}/Contents/Info.plist
81         ${CP} contrib/darwin/git-cola ${cola_app}/Contents/MacOS
82         ${CP} contrib/darwin/git-cola.icns ${cola_app}/Contents/Resources
83         ${GARDEN} -vv -D prefix=${cola_app_resources} install
84         ${GARDEN} -vv doc
85         ${GARDEN} -vv -D prefix=${cola_app_resources} install docs
86       man: ${GARDEN} -vv man docs
87       po: |
88         for po in cola/i18n/*.po
89         do
90             ${MSGMERGE} \
91                 --no-wrap \
92                 --no-fuzzy-matching \
93                 --sort-output \
94                 --output-file $$po.new \
95                 $$po \
96                 cola/i18n/git-cola.pot
97             mv $$po.new $$po
98         done
99       pot: |
100         ${XGETTEXT} \
101             --language=Python \
102             --keyword=N_ \
103             --no-wrap \
104             --omit-header \
105             --sort-output \
106             --output-dir cola/i18n \
107             --output git-cola.pot \
108             cola/*.py \
109             cola/*/*.py
110       pages<: doc
111       pages: ${GARDEN} -vv -D prefix=${TREE_PATH}/pages install docs "$@"
112       run: ${activate} ./bin/git-cola "$@"
113       run/qt6: ${activate} QT_API=PyQt6 ./bin/git-cola "$@"
114       test: ${activate} ${PYTEST_CMD} cola test "$@"
115       tox: ${TOX} run "$@"
116       tox/check: ${TOX} run -e check "$@"
117     gitconfig:
118       remote.publish.pushurl:
119         - "git@gitlab.com:git-cola/git-cola.git"
120         - "git@github.com:git-cola/git-cola.git"
121     remotes:
122       BaumiCoder: "https://github.com/BaumiCoder/git-cola.git"
123       DasaniT: "https://github.com/DasaniT/git-cola.git"
124       Mailaender: "https://github.com/Mailaender/git-cola.git"
125       Mithil467: "https://github.com/Mithil467/git-cola.git"
126       NielBuys: "https://github.com/NielBuys/git-cola.git"
127       WNguyen14: "https://github.com/WNguyen14/git-cola.git"
128       abid1998: "https://github.com/abid1998/git-cola.git"
129       achernet: "https://github.com/achernet/git-cola.git"
130       axel-h: "https://github.com/axel-h/git-cola.git"
131       bearsh: "https://github.com/bearsh/git-cola.git"
132       bensmrs: "https://github.com/bensmrs/git-cola.git"
133       bobvanderlinden: "https://github.com/bobvanderlinden/git-cola.git"
134       brccabral: "https://github.com/brccabral/git-cola.git"
135       davvid: "git@github.com:davvid/git-cola.git"
136       dschwoerer: "https://github.com/dschwoerer/git-cola.git"
137       florisla: "https://github.com/florisla/git-cola.git"
138       fu7mu4: "https://github.com/fu7mu4/git-cola.git"
139       gdebure: "https://github.com/gdebure/git-cola.git"
140       github: "git@github.com:git-cola/git-cola.git"
141       guoyunhe: "https://github.com/guoyunhe/git-cola.git"
142       gyuris: "https://github.com/gyuris/git-cola.git"
143       haffmans: "https://github.com/haffmans/git-cola.git"
144       harmathy: "https://github.com/harmathy/git-cola.git"
145       hsoft: "https://github.com/hsoft/git-cola.git"
146       jamie-pate: "https://github.com/jamie-pate/git-cola.git"
147       kenyuy: "https://github.com/kenyuy/git-cola.git"
148       kisaragi-hiu: "https://github.com/kisaragi-hiu/git-cola.git"
149       kneirinck: "https://github.com/kneirinck/git-cola.git"
150       kurtmckee: "https://github.com/kurtmckee/git-cola.git"
151       laerreal: "https://github.com/laerreal/git-cola.git"
152       lah7: "https://github.com/lah7/git-cola.git"
153       living180: "https://github.com/living180/git-cola.git"
154       ljhcage: "https://github.com/ljhcage/git-cola.git"
155       malpas: "https://github.com/malpas/git-cola.git"
156       melkecelioglu: "https://github.com/melkecelioglu/git-cola.git"
157       milestone12: "https://github.com/milestone12/git-cola.git"
158       mmargoliono: "https://github.com/mmargoliono/git-cola"
159       mp-chet: "https://github.com/mp-chet/git-cola.git"
160       nakanoi: "https://github.com/nakanoi/git-cola.git"
161       nandalopes: "https://github.com/nandalopes/git-cola.git"
162       OriShalhon: "https://github.com/OriShalhon/git-cola.git"
163       pilarmolinalopez: "https://github.com/pilarmolinalopez/git-cola.git"
164       quintusfelix: "https://github.com/quintusfelix/git-cola.git"
165       rafaelreuber: "https://github.com/rafaelreuber/git-cola.git"
166       scop: "https://github.com/scop/git-cola.git"
167       sergei-dyshel: "https://github.com/sergei-dyshel/git-cola.git"
168       sthalik: "https://github.com/sthalik/git-cola.git"
169       skunkwerks: "https://github.com/skunkwerks/git-cola.git"
170       takluyver: "https://github.com/takluyver/git-cola.git"
171       thk123: "https://github.com/thk123/git-cola.git"
172       timgates42: "https://github.com/timgates42/git-cola.git"
173       vdragon: "https://github.com/Vdragon/git-cola.git"
174       victorhck: "https://github.com/victorhck/git-cola.git"
175       virtualstaticvoid: "https://github.com/virtualstaticvoid/git-cola.git"
176       wm4: "https://github.com/wm4/git-cola.git"
177       wojnilowicz: "https://github.com/wojnilowicz/git-cola.git"
178       yaellevy: "https://github.com/yaellevy/git-cola.git"
179   deb:
180     description: Debian packaging
181     url: "git@gitlab.com:git-cola/git-cola-debian.git"
182     remotes:
183       davvid: "git@github.com:davvid/git-cola-debian.git"
184   docs:
185     description: Sphinx documentation
186     variables:
187       env_dir: ../env3
188     commands:
189       clean: rm -fr _build
190       doctest: ${activate} ${SPHINX_CMD} -b doctest . _build/doctest "$@"
191       html: ${activate} ${SPHINX_CMD} -b html . _build/html "$@"
192       man: ${activate} ${SPHINX_CMD} -b man . _build/man "$@"
193       linkcheck: ${activate} ${SPHINX_CMD} -b linkcheck . _build/linkcheck "$@"
194       install: |
195         ${MKDIR_P} ${DESTDIR}${docdir}
196         ${INSTALL} -m 644 *.html ${DESTDIR}${docdir}
197         ${INSTALL} -m 644 *.rst ${DESTDIR}${docdir}
198         # HTML documentation
199         ${MKDIR_P} ${DESTDIR}${htmldir}
200         ${RSYNC_CMD} _build/html/ ${DESTDIR}${htmldir}/
201         # Manual pages
202         ${MKDIR_P} ${DESTDIR}${mandir}
203         ${INSTALL} -m 644 _build/man/git-cola.1 ${DESTDIR}${mandir}
204         ${INSTALL} -m 644 _build/man/git-dag.1 ${DESTDIR}${mandir}
205   fedora:
206     description: Fedora packaging
207     url: "https://src.fedoraproject.org/rpms/git-cola.git"
208     remotes:
209       git-cola: "git@gitlab.com:git-cola/git-cola-fedora.git"
210       davvid: "git@github.com:davvid/git-cola-fedora.git"
211   flatpak:
212     description: Flatpak packaging
213     url: "git@github.com:flathub/com.github.git_cola.git-cola.git"
214     variables:
215       app-id: com.github.git_cola.git-cola
216     commands:
217       build: flatpak-builder "$@" --user "${prefix}" ${app-id}.yml
218       check: flatpak run --command=flatpak-builder-lint org.flatpak.Builder "$@" --exceptions builddir "${prefix}"
219       install: flatpak-builder "$@" --install --user "${prefix}" ${app-id}.yml
220       run: flatpak run ${app-id}
221       setup: |
222         flatpak remote-add --user --if-not-exists \
223           flathub https://flathub.org/repo/flathub.flatpakrepo
224         flatpak install --user \
225           org.flatpak.Builder/x86_64 \
226           org.kde.Sdk/x86_64/5.15-23.08 \
227           org.kde.Platform/x86_64/5.15-23.08 \
228           com.riverbankcomputing.PyQt.BaseApp/x86_64/5.15-23.08
229   pages:
230     description: "Git Cola's homepage"
231     url: "git@gitlab.com:git-cola/git-cola.gitlab.io.git"
232     remotes:
233       github: "git@github.com:git-cola/git-cola.github.io.git"
234       ls-jad-elkik: "git://github.com/ls-jad-elkik/git-cola.github.io.git"
235       lz-coder: "https://github.com/lz-coder/git-cola.github.io.git"
236     gitconfig:
237       remote.origin.pushurl:
238         - "git@gitlab.com:git-cola/git-cola.gitlab.io.git"
239         - "git@github.com:git-cola/git-cola.github.io.git"
240     commands:
241       build: ${JEKYLL} build --destination build "$@"
242     links:
243       - "https://git-cola.gitlab.io"
244       - "https://git-cola.github.io"
246 commands:
247   commit: git commit "$@"
248   diff: git diff "$@"
249   diffs: git diff --staged "$@"
250   fetch: git fetch "$@"
251   stat: git status --short "$@"
252   status: git status "$@"
253   stage: git add -u "$@"
254   push: git push "$@"
255   pull: git pull --ff-only "$@"
257 # Variables can be overridden externally using "garden -D name=value ...".
258 variables:
259   # Traditional DESTDIR + prefix variables
260   DESTDIR: ""
261   prefix: ${GARDEN_CONFIG_DIR}/dist
262   docdir: ${prefix}/share/doc/git-cola
263   htmldir: ${docdir}/html
264   mandir: ${prefix}/share/man/man1
265   cola_app: ${TREE_PATH}/git-cola.app
266   cola_app_resources: ${cola_app}/Contents/Resources
267   cola_full_version: $ ./bin/git-cola version --brief
268   cola_version: $ ${SED} -e "s/VERSION = '\(.*\)'/\1/"  cola/_version.py
269   is_virtualenv: |
270     $ ${PYTHON} -c '
271     import os, sys
272     if sys.prefix != sys.base_prefix or os.environ.get("VIRTUAL_ENV"):
273         print("true")
274     '
275   env_dir: env3
276   activate: |
277     if test -z "${is_virtualenv}" && test -f "${env_dir}/bin/activate"
278     then
279         source "${env_dir}/bin/activate"
280     fi
281   # External commands and options
282   CERCIS: cercis
283   CP: cp
284   GARDEN: garden
285   GIT: git
286   GREP: grep
287   INSTALL: install
288   JEKYLL: jekyll
289   MKDIR_P: mkdir -p
290   MSGMERGE: msgmerge
291   PIP: pip
292   PYTEST: ${activate} ${PYTHON} -B -m pytest
293   PYTEST_OPTIONS: $ test "$(uname -s)" != "Linux" && printf '%s' --ignore=cola/inotify.py
294   PYTEST_CMD: ${PYTEST} ${PYTEST_OPTIONS}
295   PYTHON: python3
296   RSYNC: rsync
297   RSYNC_CMD: ${RSYNC} -r --delete --exclude=.buildinfo
298   SED: sed
299   SPHINX: ${PYTHON} -m sphinx
300   SPHINX_CMD: ${SPHINX} -d _build/doctrees -a
301   TOX: tox
302   XARGS: xargs
303   XGETTEXT: xgettext