• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H11-Jul-2021-32

bin/H11-Jul-2021-12983

cola/H11-Jul-2021-35,37727,307

contrib/H11-Jul-2021-1,149905

docs/H03-May-2022-

extras/H11-Jul-2021-1,281859

po/H11-Jul-2021-55,92140,424

qtpy/H11-Jul-2021-2,1541,347

requirements/H03-May-2022-

share/H11-Jul-2021-2,0891,631

test/H11-Jul-2021-2,8452,179

.flake8H A D11-Jul-2021262 1110

.gitignoreH A D11-Jul-2021271 2928

.mailmapH A D11-Jul-2021801 1716

.pylintrcH A D11-Jul-202111.1 KiB364247

.travis.ymlH A D11-Jul-2021795 3831

CHANGES.rstH A D11-Jul-2021117.2 KiB3,4962,554

CONTRIBUTING.mdH A D11-Jul-20217 KiB191127

COPYINGH A D11-Jul-202117.6 KiB340281

COPYRIGHTH A D11-Jul-202155 21

MakefileH A D03-May-20228.6 KiB334248

README.mdH A D11-Jul-202114.8 KiB472310

pynsist.cfgH A D11-Jul-20211.6 KiB6051

pyproject.tomlH A D11-Jul-2021195 96

pytest.iniH A D11-Jul-2021279 87

setup.cfgH A D11-Jul-2021728 4236

setup.pyH A D03-May-20224.2 KiB147102

tox.iniH A D11-Jul-2021655 3431

README.md

1# git-cola: The highly caffeinated Git GUI
2
3    git-cola is a powerful Git GUI with a slick and intuitive user interface.
4
5    Copyright (C) 2007-2020, David Aguilar and contributors
6
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20## SCREENSHOTS
21
22Screenshots are available on the
23[git-cola screenshots page](https://git-cola.github.io/screenshots.html).
24
25## DOWNLOAD
26
27    apt install git-cola
28
29New releases are available on the
30[git-cola download page](https://git-cola.github.io/downloads.html).
31
32## FORK
33
34    git clone git://github.com/git-cola/git-cola.git
35
36[![git-cola build status](https://api.travis-ci.org/git-cola/git-cola.svg?branch=main)](https://travis-ci.org/git-cola/git-cola)
37
38[git-cola on github](https://github.com/git-cola/git-cola)
39
40[git-cola google group](https://groups.google.com/group/git-cola/)
41
42
43# NUTRITIONAL FACTS
44
45## ACTIVE INGREDIENTS
46
47* [git](https://git-scm.com/) 1.6.3 or newer.
48
49* [Python](https://python.org/) 2.6 or newer (Python 2+3 compatible).
50
51* [QtPy](https://github.com/spyder-ide/qtpy) 1.1.0 or newer.
52
53* [argparse](https://pypi.python.org/pypi/argparse) 1.1 or newer.
54  argparse is part of the stdlib in Python 2.7; install argparse separately if
55  you are running on Python 2.6.
56
57* [Sphinx](http://sphinx-doc.org/) for building the documentation.
58
59git-cola uses QtPy, so you can choose between PyQt4, PyQt5, and
60PySide by setting the `QT_API` environment variable to `pyqt4`, `pyqt5` or
61`pyside` as desired.  `qtpy` defaults to `pyqt5` and falls back to `pyqt4`
62if `pyqt5` is not installed.
63
64Any of the following Python Qt libraries must be installed:
65
66* [PyQt4](https://www.riverbankcomputing.com/software/pyqt/download)
67  4.6 or newer
68
69* [PyQt5](https://www.riverbankcomputing.com/software/pyqt/download5)
70  5.2 or newer
71
72* [PySide](https://github.com/PySide/PySide)
73  1.1.0 or newer
74
75Set `QT_API=pyqt4` in your environment if you have both
76versions of PyQt installed and want to ensure that PyQt4 is used.
77
78## ADDITIVES
79
80git-cola enables additional features when the following
81Python modules are installed.
82
83[send2trash](https://github.com/hsoft/send2trash) enables cross-platform
84"Send to Trash" functionality.
85
86# BREWING INSTRUCTIONS
87
88## RUN FROM SOURCE
89
90You don't need to install git-cola to run it.
91Running git-cola from its source tree is the easiest
92way to try the latest version.
93
94    git clone git://github.com/git-cola/git-cola.git
95    cd git-cola
96    ./bin/git-cola
97    ./bin/git-dag
98
99You can also start `cola` as a Python module if Python can find it.
100
101    cd git-cola
102    python -m cola
103    python -m cola dag
104
105Having git-cola's `bin/` directory in your path allows you to run
106`git cola` like a regular built-in Git command:
107
108    # Replace "$PWD/bin" with the path to git-cola's bin/ directory
109    PATH="$PWD/bin":"$PATH"
110    export PATH
111
112    git cola
113    git dag
114
115The instructions below assume that you have git-cola present in your
116`$PATH`.  Replace "git cola" with "./bin/git-cola" as needed if you'd like to
117just run it in-place.
118
119# DOCUMENTATION
120
121* [HTML documentation](https://git-cola.readthedocs.io/en/latest/)
122
123* [git-cola manual](share/doc/git-cola/git-cola.rst)
124
125* [git-dag manual](share/doc/git-cola/git-dag.rst)
126
127* [Keyboard shortcuts](https://git-cola.github.io/share/doc/git-cola/hotkeys.html)
128
129* [Contributing guidelines](CONTRIBUTING.md)
130
131# INSTALLATION
132
133Normally you can just do "make install" to install git-cola
134in your `$HOME` directory (`$HOME/bin`, `$HOME/share`, etc).
135If you want to do a global install you can do
136
137    make prefix=/usr install
138
139The platform-specific installation methods below use the native
140package manager.  You should use one of these so that all of git-cola's
141dependencies are installed.
142
143Distutils is used by the `Makefile` via `setup.py` to install git-cola and
144its launcher scripts.  distutils replaces the `#!/usr/bin/env python` lines in
145scripts with the full path to python at build time, which can be undesirable
146when the runtime python is not the same as the build-time python.  To disable
147the replacement of the `#!/usr/bin/env python` lines, pass `USE_ENV_PYTHON=1`
148to `make`.
149
150## LINUX
151
152Linux is it! Your distro has probably already packaged git-cola.
153If not, please file a bug against your distribution ;-)
154
155### arch
156
157Available in the [AUR](https://aur.archlinux.org/packages/git-cola/).
158
159### debian, ubuntu
160
161    apt install git-cola
162
163### fedora
164
165    dnf install git-cola
166
167### gentoo
168
169    emerge git-cola
170
171### opensuse, sle
172
173    zypper install git-cola
174
175### slackware
176
177Available in [SlackBuilds.org](http://slackbuilds.org/result/?search=git-cola).
178
179### FreeBSD
180
181    # install from official binary packages
182    pkg install -r FreeBSD devel/git-cola
183    # build from source
184    cd /usr/ports/devel/git-cola && make clean install
185
186## Ubuntu
187
188[See here](https://packages.ubuntu.com/search?keywords=git-cola) for the
189versions that are available in Ubuntu's repositories.
190
191There was a [PPA by @pavreh](https://launchpad.net/~pavreh/+archive/ubuntu/git-cola)
192but it has not been updated for a while.
193
194## MAC OS X
195
196[Homebrew](https://brew.sh/) is the easiest way to install
197git-cola's Qt4 and PyQt4 dependencies.  We will use Homebrew to install
198the git-cola recipe, but build our own .app bundle from source.
199
200[Sphinx](http://sphinx-doc.org/latest/install.html) is used to build the
201documentation.
202
203    brew install sphinx-doc
204    brew install git-cola
205
206Once brew has installed git-cola you can:
207
2081. Clone git-cola
209
210    `git clone git://github.com/git-cola/git-cola.git && cd git-cola`
211
2122. Build the git-cola.app application bundle
213
214    ```
215    make \
216        PYTHON=$(brew --prefix python3)/bin/python3 \
217        PYTHON_CONFIG=$(brew --prefix python3)/bin/python3-config \
218        SPHINXBUILD=$(brew --prefix sphinx-doc)/bin/sphinx-build \
219        git-cola.app
220   ```
221
2223. Copy it to /Applications
223
224    `rm -fr /Applications/git-cola.app && cp -r git-cola.app /Applications`
225
226Newer versions of Homebrew install their own `python3` installation and
227provide the `PyQt5` modules for `python3` only.  You have to use
228`python3 ./bin/git-cola` when running from the source tree.
229
230### UPGRADING USING HOMEBREW
231
232If you upgrade using `brew` then it is recommended that you re-install
233git-cola's dependencies when upgrading.  Re-installing ensures that the
234Python modules provided by Homebrew will be properly set up.
235
236A quick fix when upgrading to newer versions of XCode or macOS is to
237reinstall pyqt5.
238
239    brew reinstall pyqt@5
240
241You may also need to relink your pyqt installation:
242
243    brew link pyqt@5
244
245This is required when upgrading to a modern (post-10.11 El Capitan) Mac OS X.
246Homebrew now bundles its own Python3 installation instead of using the
247system-provided default Python.
248
249If the "brew reinstall" command above does not work then re-installing from
250scratch using the instructions below should get things back in shape.
251
252    # update homebrew
253    brew update
254
255    # uninstall git-cola and its dependencies
256    brew uninstall git-cola
257    brew uninstall pyqt5
258    brew uninstall sip
259
260    # re-install git-cola and its dependencies
261    brew install git-cola
262
263## WINDOWS INSTALLATION
264
265IMPORTANT If you have a 64-bit machine, install the 64-bit versions only.
266Do not mix 32-bit and 64-bit versions.
267
268Download and install the following:
269
270* [Git for Windows](https://git-for-windows.github.io/)
271
272* [Git Cola](https://github.com/git-cola/git-cola/releases)
273
274Once these are installed you can run Git Cola from the Start menu.
275
276See "WINDOWS (continued)" below for more details.
277
278# GOODIES
279
280git cola ships with an interactive rebase editor called `git-cola-sequence-editor`.
281`git-cola-sequence-editor` is used to reorder and choose commits when rebasing.
282Start an interactive rebase through the "Rebase" menu, or through the
283`git cola rebase` sub-command to use the `git-cola-sequence-editor`:
284
285    git cola rebase origin/main
286
287git-cola-sequence-editor can be launched independently of git cola by telling
288`git rebase` to use it as its editor through the `GIT_SEQUENCE_EDITOR`
289enviironment variable:
290
291    env GIT_SEQUENCE_EDITOR="$PWD/bin/git-cola-sequence-editor" \
292    git rebase -i origin/main
293
294# COMMAND-LINE TOOLS
295
296The git-cola command exposes various sub-commands that allow you to quickly
297launch tools that are available from within the git-cola interface.
298For example, `./bin/git-cola find` launches the file finder,
299and `./bin/git-cola grep` launches the grep tool.
300
301See `git cola --help-commands` for the full list of commands.
302
303    $ git cola --help-commands
304    usage: git-cola [-h]
305
306                    {cola,am,archive,branch,browse,config,
307                     dag,diff,fetch,find,grep,merge,pull,push,
308                     rebase,remote,search,stash,tag,version}
309                    ...
310
311    valid commands:
312      {cola,am,archive,branch,browse,config,
313       dag,diff,fetch,find,grep,merge,pull,push,
314       rebase,remote,search,stash,tag,version}
315
316        cola                start git-cola
317        am                  apply patches using "git am"
318        archive             save an archive
319        branch              create a branch
320        browse              browse repository
321        config              edit configuration
322        dag                 start git-dag
323        diff                view diffs
324        fetch               fetch remotes
325        find                find files
326        grep                grep source
327        merge               merge branches
328        pull                pull remote branches
329        push                push remote branches
330        rebase              interactive rebase
331        remote              edit remotes
332        search              search commits
333        stash               stash and unstash changes
334        tag                 create tags
335        version             print the version
336
337## HACKING
338
339The following commands should be run during development:
340
341    # Run the unit tests
342    $ make test
343
344    # Run tests and longer-running pylint and flake8 checks
345    $ make check
346
347    # Run tests against multiple python interpreters using tox
348    $ make tox
349
350The test suite can be found in the [test](test) directory.
351
352The tests are set up to run automatically when code is pushed using
353[Travis CI](https://travis-ci.org/git-cola/git-cola).
354Checkout the [Travis config file](.travis.yml) for more details.
355
356Auto-format `po/*.po` files before committing when updating translations:
357
358    $ make po
359
360When submitting patches, consult the
361[contributing guidelines](CONTRIBUTING.md).
362
363## SOURCE INSTALL
364
365For Linux/Unix-like environments with symlinks, an easy way to use the latest
366`git cola` is to keep a clone of the repository and symlink it into your
367`~/bin` directory.  If `$HOME/bin` is not already in your `$PATH` you can
368add these two lines to the bottom of your `~/.bashrc` to make the linked
369tools available.
370
371        PATH="$HOME/bin":"$PATH"
372        export PATH
373
374Then, install git-cola by linking it into your `~/bin`:
375
376        mkdir -p ~/src ~/bin
377        git clone git://github.com/git-cola/git-cola.git ~/src/git-cola
378        (cd ~/bin &&
379         ln -s ../src/git-cola/bin/git-cola &&
380         ln -s ../src/git-cola/bin/git-dag)
381
382You should then get the latest `git cola` in your shell.
383
384
385## PACKAGING NOTES
386
387Git Cola installs its modules into the default Python site-packages directory
388(eg. `lib/python2.7/site-packages`), and in its own private `share/git-cola/lib`
389area by default.  The private modules are redundant and not needed when cola's modules
390have been installed into the site-packages directory.
391
392Git Cola will prefer its private modules when the `share/git-cola/lib` directory
393exists, but they are not required to exist.  This directory is optional, and can
394be safely removed if the cola modules have been installed into site-pacakges
395and are importable through the default `sys.path`.
396
397To suppress the installation of the private (redundant) `share/git-cola/lib/cola`
398package, specify `make NO_PRIVATE_LIBS=1 ...` when invoking `make`,
399or export `GIT_COLA_NO_PRIVATE_LIBS=1` into the build enviornment.
400
401    make NO_PRIVATE_LIBS=1 ...
402
403Git Cola installs a vendored copy of its QtPy dependency by default.
404Git Cola provides a copy of the `qtpy` module in its private modules area
405when installing Git Cola so that you are not required to install QtPy separately.
406If you'd like to provide your own `qtpy` module, for example from the `python-qtpy`
407Debian package, then specify `make NO_VENDOR_LIBS=1 ...` when invoking `make`,
408or export `GIT_COLA_NO_VENDOR_LIBS=1` into the build environment.
409
410    make NO_VENDOR_LIBS=1 ...
411
412Python3 users on debian will need to install `python3-distutils` in order
413to run the Makefile's installation steps.  `distutils` is a Python build
414requirement, but not needed at runtime.
415
416# WINDOWS (continued)
417
418## Development
419
420In order to develop Git Cola on Windows you will need to install
421Python3 and pip.  Install PyQt5 using `pip install PyQt5`
422to make the PyQt5 bindings available to Python.
423
424Once these are installed you can use `python.exe` to run
425directly from the source tree.  For example, from a Git Bash terminal:
426
427    /c/Python36/python.exe ./bin/git-cola
428
429## Multiple Python versions
430
431If you have multiple versions of Python installed, the `contrib/win32/cola`
432launcher script might choose the newer version instead of the python
433that has PyQt installed.  In order to resolve this, you can set the
434`cola.pythonlocation` git configuration variable to tell cola where to
435find python.  For example:
436
437    git config --global cola.pythonlocation /c/Python36
438
439## BUILDING WINDOWS INSTALLERS
440
441Windows installers are built using
442
443* [Pynsist](https://pynsist.readthedocs.io/en/latest/).
444
445* [NSIS](http://nsis.sourceforge.net/Main_Page) is also needed.
446
447To build the installer using Pynsist run:
448
449    ./contrib/win32/run-pynsist.sh
450
451This will generate an installer in `build/nsis/`.
452
453## WINDOWS HISTORY BROWSER CONFIGURATION UPGRADE
454
455You may need to configure your history browser if you are upgrading from an
456older version of Git Cola.
457
458`gitk` was originally the default history browser, but `gitk` cannot be
459launched as-is on Windows because `gitk` is a shell script.
460
461If you are configured to use `gitk`, then change your configuration to
462go through Git's `sh.exe` on Windows.  Similarly, we must go through
463`python.exe` if we want to use `git-dag`.
464
465If you want to use gitk as your history browser open the
466Preferences screen and change the history browser command to:
467
468    "C:/Program Files/Git/bin/sh.exe" --login -i C:/Git/bin/gitk
469
470git-dag became the default history browser on Windows in `v2.3`, so new
471users should not need to configure anything.
472