Git Plugin for Trac
Description
This is yet another plugin for Trac 0.10/0.11 which enables GIT to be used instead of Subversion for the trac:VersioningSystemBackend
Features
- Browsing source code in a Git repository via the TracBrowser
- Viewing the change history of a file or directory using TracRevisionLog
- Performing diffs between any two files or two directories
- Displaying submitted changes in the TracTimeline (0.11)
- (Optionally) caching TracChangeset information in Trac's database (0.11)
- Caching Git commit relation graph in memory (0.11)
- Using the TracSearch page to search change descriptions (0.11)
- Annotation support, also known as "blame" operation (0.11)
- Interpretation of 40-character wide hex-strings as sha1 commit checksums
- ...
Requirements
| 0.10 Plugin | 0.11 Plugin | |
| Trac | 0.10.x | 0.11.x |
| Python | 2.4+ | 2.5 |
| GIT | 1.4.4+ | 1.5.2+ |
Example Sites
- The GIT repositories at Fedora Hosted
- nanosleep.org's GitPlugin branch
- GNU Parted
- ReductiveLabs Puppet
- Ohloh Labs
Bugs/Feature Requests
As this is for now just a proof of concept implementation, it has quite some deficiencies, some of which exist as tickets already:
- #746
- Improve performance of GitPlugin
- #1040
- support for multiple repos
- #2633
- It should be possible to see the branch in the timeline and for each changeset
- #2671
- Traceback on nonexistent paths with 0.10 git plugin
- #2685
- shortrev_len does not work
- #2854
- Traceback after enabling CachedRepository
- #3104
- internal error (got unexpected object kind 'commit') when going to "Browse source"
- #3411
- Python 2.4 backport (done)
- #3512
- On Win32 environment gitplugin cannot execute git.
- #3593
- Improve display of merge changesets
- #3654
- AssertionError when selecting browse source
- #3675
- defunkt and open processes
- #3842
- Error calculating changeset size? TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
- #3888
- WikiLinking branch heads?
- #4133
- [GitPlugin] GitPlugin hate accent
- #4139
- GitPlugin doesn't handle fresh repositories well
...and other potential issues/todos which aren't ticket-tracked yet:
does not highlight sha1sums automatically- issues with filenames containing newlines (seems to be a Trac bug)
- ...
Existing bugs and feature requests for GitPlugin are here (all including closed ones are here).
If you have any issues, create a new ticket.
Download, Source
Download the zipped source, check out GitPlugin from Subversion, or browse the source.
(An experimental branch of this plugin with a hacky caching feature and some bug fixes is available from here.)
Configuration
Simply point your Trac instance to a local git repository:
[trac] repository_dir = /var/git/Test.git repository_type = git ## the following is only for the 0.11 branch [git] ## let Trac cache meta-data via CachedRepository wrapper; default: false cached_repository = true ## disable automatic garbage collection for in-memory commit-tree cache; default: false persistent_cache = true ## length revision sha-sums should be tried to be abbreviated to (must be >= 4 and <= 40); default: 7 shortrev_len = 6 ## executable file name (optionally with path) of git binary; default: 'git' git_bin = /usr/src/git-dev/git
/!\ NOTE: the Test.git above needs to be the .git repository directory (i.e. the one containing the file HEAD and config), not the working tree directory that holds the .git/ folder.
If installed globally, don't forget to enable the plugin:
[components] # for plugin version 0.10 gitplugin.* = enabled # for plugin version 0.11.0.1+ tracext.git.* = enabled
Recent Changes
[4174] by hvr on 08/23/08 02:15:46
GitPlugin: fix exception on changesets that contain file-mode changes denoted by 'T'
[4148] by hvr on 08/17/08 04:59:35
GitPlugin: make diff_tree handle empty changesets (fixes #2807 and #3410)
[4147] by hvr on 08/17/08 04:17:49
GitPlugin: add (ignored) path argument to previous_rev method (fixes #3008)
[3422] by hvr on 03/27/08 03:24:12
declare namespace_packages meta-data (addresses #2806)
Author/Contributors
Author: Herbert Valerio Riedel
Contributors: Hans Petter Jansson
