GitPHP 0.2.2

I’ve released GitPHP 0.2.2. There are a number of neat enhancements in this release; you might have seen some running on the local copy on this site – javascript livesearch of the project list, ajax tree drilldown, choice of snapshot format, bugtracker linking, etc. Plus there are major enhancements on the backend, including the object cache described in a previous post, and built-in memcache support for all caching – just specify the memcache server(s) in the config and you’re good to go.

Full changelog:

  • Enhancements:
    • Atom feed support, thanks to Christian Weiske
    • Error pages now return proper HTTP error codes to avoid search engine indexing
    • Users can now choose the file format of snapshot they want, based on what’s supported by the system. The config value still controls the default for non-javascript users.
    • Directories in the config file no longer require you to specify the trailing slash
    • Overriding project settings (category, owner, description, clone url, etc) can now be done for all project listing methods – directory list, file list, and array list. Previously it could only be done with the array
    • The tree view can now be drilled down using AJAX
    • Memcache support
    • Support for linking bug numbers in commit messages to a bug tracker
    • Search box to search projects on the project list. This is a live search if you have javascript
    • Object cache, for caching immutable git data – more info on what this is and why you want it is here
    • Javascript is now minified to decrease its size
    • Clone/push urls on the project page are now links, thanks to Cory Thomas
    • Project owners are now read from the git config value gitweb.owner if set, thanks to Cory Thomas
  • Translations:
    • Russian, thanks to Aidsoid
    • German, thanks to Andy Tandler
  • Bugfixes:
    • Fix issue where commit tooltips didn’t escape HTML characters correctly
    • Project ages on the project list page now use a more accurate method to get the age
    • The default tmpdir, if not specified in the config, is read from the system/php config rather than hardcoding it. This also fixes an issue where the default tmpdir for windows was incorrect
    • Fix the default git binary for windows x64 installs
    • An error message now displays when the diff/git executable isn’t found or doesn’t work, rather than just failing silently

For those who are wondering about this post about a backwards incompatible change – the change to specify overrides for all project list formats does change the project config file (projects.conf.php) format slightly, but the code is backwards compatible and will continue to use your old project config file until you adjust it for the new changes.

As always, the release can be downloaded from the gitphp page and bugs can be reported on the bugtracker.

GitPHP 0.2.1

I’ve released GitPHP 0.2.1. This release fixes a number of the bugs that arose from the rewrite first released in 0.2.0, and also adds a number of features that I intended to add but didn’t make it into 0.2.0.

The biggest change is that my homebrew translation framework that appeared in 0.2.0 was ripped out and replaced with gettext. I apologize if you already started translating, but gettext is much easier to work with, I promise. I’ve provided a short starter HOWTO in doc/TRANSLATING. As always, you can send a translation to me for inclusion in the official release.
If you’re running gitphp from the git repo instead of the tarball, you will need to run util/msgfmt.sh from the gitphp base directory after cloning the repository to compile the gettext MO files, or else the translations won’t work. The tarball releases have this done already and will work out of the box.

Language can also be selected on the fly by users now, using a drop-down menu. The default setting for this for a first-time visitor is the browser’s preferred language if supported, followed by whatever’s specified in the gitphp config, followed by English as the final default. Check it out at the live copy.

Also, this is the first release of gitphp that provides another language besides English: gitphp is now available in French, thanks to Zaran.

The other notable enhancement is the ability for users to select arbitrary commits on the log or commit pages, and diff them. Each commit in the log or shortlog shows a “select for diff” link. Click this by a commit to select it. The selected diff will appear in the very top header of the log or shortlog, with a partial commit message (with the full commit tooltip), and the option to deselect it. The “select for diff” links by commits will now change to “diff with selected” – click this to do the diff. (The link by the currently selected commit will change to “deselect”) This selection persists across pages of the shortlog/log, so you can diff across two different pages. The selection will also persist when switching back and forth from log to shortlog and vice versa, although going to a non-log page will discard the selection. The implementation is original, but I’d like to thank Calen Pennington for some of the UI designs.

Here’s the full list of changes:

  • GitPHP now uses gettext for internationalization. I’ve also provided a short howto in doc/TRANSLATING
  • Language can now be changed on the fly by the user using a drop-down menu in the upper right. The initial default for this is the user’s preferred language from their browser. If there is no translation for the user’s language, it will fall back to the locale in the config, then to English as the final default. But of course, the user can always change the language whenever they want. The user’s language choice is remembered by a browser cookie.
  • French translation, thanks to Zaran
  • On the log and shortlog pages, arbitrary diffs can be selected and diffed. You can select one commit, then diff with any other. Your selected diff will persist across pages, in case you want to diff between two different pages. The selected diff, if there is one, will appear in the top header, above the log/shortlog. This selection will also persist when switching from the shortlog to the log and vice versa.
  • New pieces of metadata can now be specified for a project using the advanced project array format (in projects.conf.php): description, owner, clone url, and push url. Specifying any of these for a project will override that data for that project only.
  • Tree view and commit view now provide a “plain” link by blobs to go right to the plaintext view of that blob
  • Added a file history link to the blob page
  • To make things a little easier to track, the home text template that configures the header of the project list (templates/hometext.tpl) is no longer provided in the tarball. The system will show the default hometext, but you can create templates/hometext.tpl with your content to customize the header. Therefore, this is backwards compatible for everyone who already has a customized hometext.tpl template.
  • The “projects” link in the upper left that takes you to the main project list can be customized. Please be advised that if you override this, you’re also hardcoding the language that it appears in.
  • Fixed a bug where search wouldn’t work on git < 1.5.3
  • Fixed a bug where some dates wouldn’t show up correctly on windows
  • Fixed a bug where an exception would be thrown if no config file existed
  • Fixed bugs where GitPHP would crash when an empty project with no commits was being loaded
  • Fixed a bug in reading projects from a list file, where owners with multiple words in the name would only display the first word
  • Fixed a bug on the commit page, where the history link by a deleted file wouldn’t work
  • Fixed a bug where the javascript commit tooltip would appear out of the browser window for a commit close to the bottom of the page
  • XHTML validation fixes, thanks to Christian Weiske
  • Minor visual fix where source files in commit diffs were missing the “a/” prefix (but destinations files still had the “b/” prefix)

Get it on the GitPHP page.

As always, anything – bugs, enhancement requests, etc – can be reported on the Mantis bugtracker. I’d like to give a big thanks to the people that have been using the bugtracker already; it’s been a huge help in keeping me and my development organized.

I’ve also created a page for GitPHP on Ohloh, if you’re interested.

GitPHP 0.2.0

Well, it’s my birthday, which I figure is a good enough reason to finally release the GitPHP rewrite.

I’m releasing it as 0.2.0 – I figured that the architectural rewrite is significant enough to warrant some kind of larger version bump, but since it doesn’t look and behave all that differently to end users, a major version bump isn’t necessary.

Here’s what I came up with for the changelog, although as a total rewrite from scratch, there could very well be other “features” and changes that made it in that I’m not thinking of, just by virtue of the entire codebase changing:

  • Major architectural rewrite – end users aren’t heavily affected, but developers will appreciate it. On the other hand, PHP 4 is no longer supported
  • Much more simplified config that works on an override strategy – so your config file can be much cleaner
  • Can fetch snapshots of a subtree (subdirectory), rather than the entire tree – thanks to Tejas Dinkar
  • When listing out projects in the projectroot (instead of explicitly listing them in the config), can optionally respect the git-daemon-export-ok magic file used by git-daemon to include/exclude projects – thanks to Calen Pennington
  • When listing out projects in the projectroot (instead of explicitly listing them in the config), projects in subdirectories will be automatically “categorized” by their directories – thanks to Calen Pennington
  • AJAX javascript tooltips to display the full commit message when hoving over a commit link, and the full tag message for a tag object
  • Use AJAX javascript to load blame info right into the blob page, instead of posting to a separate page
  • Internationalization support, although we don’t have any translations yet
  • Blame page now supports syntax highlighting
  • New way of specifying categories for projects – in preparation for more metadata to be added to projects
  • The little colored ref badges now have different colors to distinguish between heads and tags
  • File sizes by blobs in the tree view
  • File searching shows the matching line number

In theory this will work as a drop-in replacement for previous versions – no changes necessary. However, because of the newer and cleaner config system, it might be worth it to run through your configuration again using the example and copying from the defaults file, just to clean up the amount of stuff you have to look at in your config file. Also, if you were using the method of defining projects as an array to specify categories, you might want to have a look at the new way of specifying the categories in projects.conf.php if you have a chance. You don’t gain anything from changing to the new format now so you don’t have to, but eventually new features will be added to the new format, which you won’t be able to benefit from if you aren’t using it.

As I mentioned in the previous post, internationalization is now open again, so if you’re interested in doing a translation, contact me.

As always, downloads are available on the GitPHP page, and bugs / enhancement requests can be reported on the Mantis bugtracker – with ~12000 new lines of code, I’m certaintly expecting a few unforseen bugs. Source code is always browsable on the live GitPHP.

You can always let me know what you think of the rewrite (or the project in general) by multiple means: email, commenting on my site, twitter, etc.

I hope you enjoy the new code.

Return top