From 26f3fecb17d33d8509de5f1c3ace77bb2f1d20b1 Mon Sep 17 00:00:00 2001 From: zauguin Date: Thu, 1 Nov 2012 18:43:17 +0100 Subject: [PATCH 01/27] Added support for PHP built-in Web server --- index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.php b/index.php index bed5d93..ccaf047 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,10 @@ if (!ini_get('date.timezone')) { date_default_timezone_set('UTC'); } +if(php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'], 1))) { + return false; +} + require 'vendor/autoload.php'; $app = require 'boot.php'; $app->run(); \ No newline at end of file From cb59ee81ad0e5cd0e4daec517fa66ff51d4e4e8c Mon Sep 17 00:00:00 2001 From: Knut Haugen Date: Fri, 16 Nov 2012 14:24:33 +0100 Subject: [PATCH 02/27] added file type mapping for scala files in order to provide syntax highlighting for scala files in blow view --- src/GitList/Util/Repository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index e158b95..80d783d 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -52,6 +52,7 @@ class Repository 'r' => 'r', 'sh' => 'shell', 'ss' => 'scheme', + 'scala' => 'text/x-scala', 'scm' => 'scheme', 'sls' => 'scheme', 'sps' => 'scheme', From 3d1302a501c9522f8d37111e22e123278129f4e8 Mon Sep 17 00:00:00 2001 From: Myhrlin Date: Mon, 26 Nov 2012 12:48:15 -0600 Subject: [PATCH 03/27] Added hiawatha webserver URLToolkit configuration --- INSTALL.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 580c3da..97a8477 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,5 +1,5 @@ # GitList Installation -* Download GitList from [gitlist.org](http://gitlist.org/) and decompress to your `/var/www/gitlist` folder, or anywhere else you want to place GitList. +* Download GitList from [gitlist.org](http://gitlist.org/) and decompress to your `/var/www/gitlist` folder, or anywhere else you want to place GitList. * Rename the `config.ini-example` file to `config.ini`. * Open up the `config.ini` and configure your installation. You'll have to provide where your repositories are located and the base GitList URL (in our case, http://localhost/gitlist). * Create the cache folder and give read/write permissions to your web server user: @@ -13,7 +13,7 @@ chmod 777 cache That's it, installation complete! ## Webserver configuration -Apache is the "default" webserver for GitList. You will find the configuration inside the `.htaccess` file. However, nginx and lighttpd are also supported. +Apache is the "default" webserver for GitList. You will find the configuration inside the `.htaccess` file. However, nginx and lighttpd are also supported. ### nginx server.conf @@ -73,4 +73,16 @@ url.rewrite-once = ( "^/gitlist/favicon\.ico$" => "$0", "^/gitlist(/[^\?]*)(\?.*)?" => "/gitlist/index.php$1$2" ) -``` \ No newline at end of file +``` + +### hiawatha + +``` +UrlToolkit { + ToolkitID = gitlist + RequestURI isfile Return + # If you have example.com/gitlist/ ; Otherwise remove "/gitlist" below + Match ^/gitlist/.* Rewrite /gitlist/index.php + Match ^/gitlist/.*\.ini DenyAccess +} +``` From 0fa349476a20f2148cae401115b021b37345d606 Mon Sep 17 00:00:00 2001 From: Nate Eagleson Date: Thu, 13 Dec 2012 15:41:52 -0500 Subject: [PATCH 04/27] Use checked-out branch as default branch. Previously assumed 'master' was the default branch, when master may not exist at all. --- src/GitList/Controller/CommitController.php | 12 +++++++++--- src/GitList/Controller/MainController.php | 8 +++++++- src/GitList/Util/Repository.php | 5 ++++- tests/InterfaceTest.php | 18 ++++++++++++++++++ views/index.twig | 2 +- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/GitList/Controller/CommitController.php b/src/GitList/Controller/CommitController.php index 776f669..d215074 100644 --- a/src/GitList/Controller/CommitController.php +++ b/src/GitList/Controller/CommitController.php @@ -15,6 +15,10 @@ class CommitController implements ControllerProviderInterface $route->get('{repo}/commits/{branch}/{file}', function($repo, $branch, $file) use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); + if ($branch === null) { + $branch = $repository->getHead(); + } + list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file); $type = $file ? "$branch -- \"$file\"" : $branch; @@ -41,12 +45,13 @@ class CommitController implements ControllerProviderInterface })->assert('repo', $app['util.routing']->getRepositoryRegex()) ->assert('branch', '[\w-._\/]+') ->assert('file', '.+') - ->value('branch', 'master') + ->value('branch', null) ->value('file', '') ->bind('commits'); $route->post('{repo}/commits/search', function(Request $request, $repo) use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); + $branch = $repository->getHead(); $commits = $repository->searchCommitLog($request->get('query')); foreach ($commits as $commit) { @@ -57,7 +62,7 @@ class CommitController implements ControllerProviderInterface return $app['twig']->render('searchcommits.twig', array( 'repo' => $repo, - 'branch' => 'master', + 'branch' => $branch, 'file' => '', 'commits' => $categorized, 'branches' => $repository->getBranches(), @@ -69,9 +74,10 @@ class CommitController implements ControllerProviderInterface $route->get('{repo}/commit/{commit}/', function($repo, $commit) use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); $commit = $repository->getCommit($commit); + $branch = $repository->getHead(); return $app['twig']->render('commit.twig', array( - 'branch' => 'master', + 'branch' => $branch, 'repo' => $repo, 'commit' => $commit, )); diff --git a/src/GitList/Controller/MainController.php b/src/GitList/Controller/MainController.php index 89b6f62..3262b04 100644 --- a/src/GitList/Controller/MainController.php +++ b/src/GitList/Controller/MainController.php @@ -16,6 +16,9 @@ class MainController implements ControllerProviderInterface $repositories = array_map( function ($repo) use ($app) { $repo['relativePath'] = $app['util.routing']->getRelativePath($repo['path']); + $repository = $app['git']->getRepository($repo['path']); + $repo['branch'] = $repository->getHead(); + return $repo; }, $app['git']->getRepositories($app['git.repos']) @@ -28,6 +31,9 @@ class MainController implements ControllerProviderInterface $route->get('{repo}/stats/{branch}', function($repo, $branch) use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); + if ($branch === null) { + $branch = $repository->getHead(); + } $stats = $repository->getStatistics($branch); $authors = $repository->getAuthorStatistics(); @@ -41,7 +47,7 @@ class MainController implements ControllerProviderInterface )); })->assert('repo', $app['util.routing']->getRepositoryRegex()) ->assert('branch', '[\w-._\/]+') - ->value('branch', 'master') + ->value('branch', null) ->bind('stats'); $route->get('{repo}/{branch}/rss/', function($repo, $branch) use ($app) { diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index e158b95..169ea9c 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -160,9 +160,12 @@ class Repository return false; } - public function getReadme($repo, $branch = 'master') + public function getReadme($repo, $branch = null) { $repository = $this->app['git']->getRepository($this->app['git.repos'] . $repo); + if ($branch === null) { + $branch = $repository->getHead(); + } $files = $repository->getTree($branch)->output(); foreach ($files as $file) { diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 38e437d..132d960 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -79,6 +79,16 @@ class InterfaceTest extends WebTestCase $repository->commit("Changing branch"); $repository->checkout("master"); + // master-less repository fixture + $git->createRepository(self::$tmpdir . 'masterless'); + $repository = $git->getRepository(self::$tmpdir . 'masterless'); + $repository = $repository->checkout('develop'); + file_put_contents(self::$tmpdir . 'masterless/README.md', "## masterless\nmasterless is a *test* repository!"); + file_put_contents(self::$tmpdir . 'masterless/test.php', "setConfig('user.name', 'Luke Skywalker'); + $repository->setConfig('user.email', 'luke@rebel.org'); + $repository->addAll(); + $repository->commit("Initial commit"); } public function createApplication() @@ -241,6 +251,14 @@ class InterfaceTest extends WebTestCase $this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent()); } + public function testMasterlessRepo() + { + $client = $this->createClient(); + + $crawler = $client->request('GET', '/masterless/'); + $this->assertTrue($client->getResponse()->isOk()); + } + public function testNestedRepoBranch() { $client = $this->createClient(); diff --git a/views/index.twig b/views/index.twig index 07093cd..b3f075d 100644 --- a/views/index.twig +++ b/views/index.twig @@ -10,7 +10,7 @@

{{ repository.description }}

From 9dfca14f31e04344296aca960ee5bf52817ba928 Mon Sep 17 00:00:00 2001 From: Nate Eagleson Date: Thu, 13 Dec 2012 23:21:30 -0500 Subject: [PATCH 05/27] Attempt to fix test for repo without master branch. Without a working test environment, it's hard to be confident it will succeed, but it's certainly a step closer to correct. --- tests/InterfaceTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 132d960..0a600e8 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -82,6 +82,7 @@ class InterfaceTest extends WebTestCase // master-less repository fixture $git->createRepository(self::$tmpdir . 'masterless'); $repository = $git->getRepository(self::$tmpdir . 'masterless'); + $repository->createBranch("develop"); $repository = $repository->checkout('develop'); file_put_contents(self::$tmpdir . 'masterless/README.md', "## masterless\nmasterless is a *test* repository!"); file_put_contents(self::$tmpdir . 'masterless/test.php', " Date: Wed, 19 Dec 2012 22:59:12 -0200 Subject: [PATCH 06/27] fix an exception of twig when try get ajax pagination --- src/GitList/Controller/CommitController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitList/Controller/CommitController.php b/src/GitList/Controller/CommitController.php index 776f669..8d67687 100644 --- a/src/GitList/Controller/CommitController.php +++ b/src/GitList/Controller/CommitController.php @@ -30,6 +30,7 @@ class CommitController implements ControllerProviderInterface $template = $app['request']->isXmlHttpRequest() ? 'commits_list.twig' : 'commits.twig'; return $app['twig']->render($template, array( + 'page' => 'commits', 'pager' => $pager, 'repo' => $repo, 'branch' => $branch, From 3d405d2b3f0fc7a0636d9e430464b16af6e53e2e Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:21:07 -0200 Subject: [PATCH 07/27] little change in the pattern to get match results correctly --- src/GitList/Git/Repository.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index 4c0cf91..c4c3f1c 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -65,11 +65,13 @@ class Repository extends BaseRepository continue; } - preg_match_all('/([\w-._]+):(.+):([0-9]+):(.+)/', $result, $matches, PREG_SET_ORDER); + preg_match_all('/([\w-._]+):([^:]+):([0-9]+):(.+)/', $result, $matches, PREG_SET_ORDER); + $data['branch'] = $matches[0][1]; - $data['file'] = $matches[0][2]; - $data['line'] = $matches[0][3]; - $data['match'] = $matches[0][4]; + $data['file'] = $matches[0][2]; + $data['line'] = $matches[0][3]; + $data['match'] = $matches[0][4]; + $searchResults[] = $data; } From d9237592f98597ef29a0445d427532d849678128 Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:09:01 -0200 Subject: [PATCH 08/27] display the requested query to the viewer in the breadcrumbs --- src/GitList/Controller/CommitController.php | 4 +++- src/GitList/Controller/TreeController.php | 5 +++-- views/searchcommits.twig | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/GitList/Controller/CommitController.php b/src/GitList/Controller/CommitController.php index 776f669..69f1926 100644 --- a/src/GitList/Controller/CommitController.php +++ b/src/GitList/Controller/CommitController.php @@ -47,7 +47,8 @@ class CommitController implements ControllerProviderInterface $route->post('{repo}/commits/search', function(Request $request, $repo) use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); - $commits = $repository->searchCommitLog($request->get('query')); + $query = $request->get('query'); + $commits = $repository->searchCommitLog($query); foreach ($commits as $commit) { $date = $commit->getDate(); @@ -62,6 +63,7 @@ class CommitController implements ControllerProviderInterface 'commits' => $categorized, 'branches' => $repository->getBranches(), 'tags' => $repository->getTags(), + 'query' => $query )); })->assert('repo', $app['util.routing']->getRepositoryRegex()) ->bind('searchcommits'); diff --git a/src/GitList/Controller/TreeController.php b/src/GitList/Controller/TreeController.php index fe463b7..86be94b 100644 --- a/src/GitList/Controller/TreeController.php +++ b/src/GitList/Controller/TreeController.php @@ -53,8 +53,9 @@ class TreeController implements ControllerProviderInterface $branch = $repository->getHead(); } - $breadcrumbs = $app['util.view']->getBreadcrumbs($tree); - $results = $repository->searchTree($request->get('query'), $branch); + $query = $request->get('query'); + $breadcrumbs = array(array('dir' => 'Search results for: ' . $query, 'path' => '')); + $results = $repository->searchTree($query, $branch); return $app['twig']->render('search.twig', array( 'results' => $results, diff --git a/views/searchcommits.twig b/views/searchcommits.twig index 8b2969b..20495bc 100644 --- a/views/searchcommits.twig +++ b/views/searchcommits.twig @@ -5,7 +5,7 @@ {% block title %}GitList{% endblock %} {% block content %} - {% include 'breadcrumb.twig' with {breadcrumbs: [{dir: 'Commits search results', path:''}]} %} + {% include 'breadcrumb.twig' with {breadcrumbs: [{dir: 'Commits search results for: ' ~ query, path:''}]} %} {% include 'commits_list.twig' %} From 9091aa22926af04d8b08adb62bade7b17fc72cad Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:33:24 -0200 Subject: [PATCH 09/27] fix the exceptions caused by git commands and the data returned; improves the security of the user input queries that build args for commands. --- src/GitList/Controller/CommitController.php | 2 + src/GitList/Git/Repository.php | 47 ++++++++++++++++++--- views/commits_list.twig | 4 ++ 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/GitList/Controller/CommitController.php b/src/GitList/Controller/CommitController.php index 69f1926..7039839 100644 --- a/src/GitList/Controller/CommitController.php +++ b/src/GitList/Controller/CommitController.php @@ -20,6 +20,7 @@ class CommitController implements ControllerProviderInterface $type = $file ? "$branch -- \"$file\"" : $branch; $pager = $app['util.view']->getPager($app['request']->get('page'), $repository->getTotalCommits($type)); $commits = $repository->getPaginatedCommits($type, $pager['current']); + $categorized = array(); foreach ($commits as $commit) { $date = $commit->getDate(); @@ -49,6 +50,7 @@ class CommitController implements ControllerProviderInterface $repository = $app['git']->getRepository($app['git.repos'] . $repo); $query = $request->get('query'); $commits = $repository->searchCommitLog($query); + $categorized = array(); foreach ($commits as $commit) { $date = $commit->getDate(); diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index c4c3f1c..3d7a568 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -4,10 +4,39 @@ namespace GitList\Git; use Gitter\Repository as BaseRepository; use Gitter\Model\Commit\Commit; +use Gitter\PrettyFormat; use Symfony\Component\Filesystem\Filesystem; class Repository extends BaseRepository { + + /** + * Show the data from a specific commit + * + * @param string $commitHash Hash of the specific commit to read data + * @return array Commit data + */ + public function getCommit($commitHash) + { + $logs = $this->getClient()->run($this, "show --pretty=format:\"%H%h%T%P%an%ae%at%cn%ce%ct\" $commitHash"); + $logs = explode("\n", $logs); + + // Read commit metadata + $format = new PrettyFormat; + $data = $format->parse($logs[0]); + $commit = new Commit; + $commit->importData($data[0]); + unset($logs[0]); + + if (empty($logs[1])) { + $logs = explode("\n", $this->getClient()->run($this, 'diff ' . $commitHash . '~1..' . $commitHash)); + } + + $commit->setDiffs($this->readDiffLogs($logs)); + + return $commit; + } + /** * Show the repository commit log with pagination * @@ -18,13 +47,17 @@ class Repository extends BaseRepository { $page = 15 * $page; $pager = "--skip=$page --max-count=15"; - $command = "log $pager --pretty=format:'%H%h%T%P%an%ae%at%cn%ce%ct'"; + $command = "log $pager --pretty=format:\"%H%h%T%P%an%ae%at%cn%ce%ct\""; if ($file) { $command .= " $file"; } - $logs = $this->getPrettyFormat($command); + try { + $logs = $this->getPrettyFormat($command); + } catch (\RuntimeException $e) { + return array(); + } foreach ($logs as $log) { $commit = new Commit; @@ -37,9 +70,13 @@ class Repository extends BaseRepository public function searchCommitLog($query) { - $command = "log --grep='$query' --pretty=format:'%H%h%T%P%an%ae%at%cn%ce%ct'"; + $command = "log --grep=".escapeshellarg($query)." --pretty=format:\"%H%h%T%P%an%ae%at%cn%ce%ct\""; - $logs = $this->getPrettyFormat($command); + try { + $logs = $this->getPrettyFormat($command); + } catch (\RuntimeException $e) { + return array(); + } foreach ($logs as $log) { $commit = new Commit; @@ -53,7 +90,7 @@ class Repository extends BaseRepository public function searchTree($query, $branch) { try { - $results = $this->getClient()->run($this, "grep -I --line-number '$query' $branch"); + $results = $this->getClient()->run($this, "grep -I --line-number ".escapeshellarg($query)." $branch"); } catch (\RuntimeException $e) { return false; } diff --git a/views/commits_list.twig b/views/commits_list.twig index 959d9ff..cdab179 100644 --- a/views/commits_list.twig +++ b/views/commits_list.twig @@ -1,3 +1,4 @@ +{% if commits %} {% for date, commit in commits %} @@ -19,6 +20,9 @@
{% endfor %} +{% else %} +

No results found.

+{% endif %} {% if page != 'searchcommits' %}
    From 69e1200b04ba6dc8b63c72d4fbcdc54e8a83346c Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:14:20 -0200 Subject: [PATCH 10/27] fix usability mistakes on navigation menu and search input --- src/GitList/Controller/CommitController.php | 5 +++-- views/layout_page.twig | 4 ++-- views/menu.twig | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/GitList/Controller/CommitController.php b/src/GitList/Controller/CommitController.php index 776f669..ad4648d 100644 --- a/src/GitList/Controller/CommitController.php +++ b/src/GitList/Controller/CommitController.php @@ -45,7 +45,7 @@ class CommitController implements ControllerProviderInterface ->value('file', '') ->bind('commits'); - $route->post('{repo}/commits/search', function(Request $request, $repo) use ($app) { + $route->post('{repo}/commits/{branch}/search', function(Request $request, $repo, $branch = '') use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); $commits = $repository->searchCommitLog($request->get('query')); @@ -57,13 +57,14 @@ class CommitController implements ControllerProviderInterface return $app['twig']->render('searchcommits.twig', array( 'repo' => $repo, - 'branch' => 'master', + 'branch' => $branch, 'file' => '', 'commits' => $categorized, 'branches' => $repository->getBranches(), 'tags' => $repository->getTags(), )); })->assert('repo', $app['util.routing']->getRepositoryRegex()) + ->assert('branch', '[\w-._\/]+') ->bind('searchcommits'); $route->get('{repo}/commit/{commit}/', function($repo, $commit) use ($app) { diff --git a/views/layout_page.twig b/views/layout_page.twig index 97f51f3..02919b9 100644 --- a/views/layout_page.twig +++ b/views/layout_page.twig @@ -6,8 +6,8 @@
    - {% if page == 'commits' %} - {% else %} diff --git a/views/menu.twig b/views/menu.twig index 2a6574d..d35bd4e 100644 --- a/views/menu.twig +++ b/views/menu.twig @@ -1,5 +1,5 @@ From 2e69e9d435f19ea016cb0d945014e4ca49be591b Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:34:14 -0200 Subject: [PATCH 11/27] ignore composer.lock --- .gitignore | 2 +- composer.lock | 621 -------------------------------------------------- 2 files changed, 1 insertion(+), 622 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index e9b0612..de5dac4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ nbproject node_modules config.ini cache.properties -composer.phar +composer.* \ No newline at end of file diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 786811c..0000000 --- a/composer.lock +++ /dev/null @@ -1,621 +0,0 @@ -{ - "hash": "b1fc3d7e61707618f68e5cf940e97081", - "packages": [ - { - "name": "klaussilveira/gitter", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/klaussilveira/gitter", - "reference": "1c9b6e4dde81d21acffe99d9f4559ed3bc59f947" - }, - "dist": { - "type": "zip", - "url": "https://github.com/klaussilveira/gitter/zipball/1c9b6e4dde81d21acffe99d9f4559ed3bc59f947", - "reference": "1c9b6e4dde81d21acffe99d9f4559ed3bc59f947", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "symfony/process": ">=2.1" - }, - "require-dev": { - "symfony/filesystem": ">=2.1" - }, - "time": "1351643953", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "Gitter": "lib/" - } - }, - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Klaus Silveira", - "email": "klaussilveira@php.net", - "homepage": "http://www.klaussilveira.com/", - "role": "Developer" - } - ], - "description": "Gitter allows you to interact in an object oriented manner with Git repositories.", - "homepage": "https://github.com/klaussilveira/gitter", - "keywords": [ - "git", - "vcs" - ] - }, - { - "name": "pimple/pimple", - "version": "dev-master", - "source": { - "type": "git", - "url": "git://github.com/fabpot/Pimple.git", - "reference": "b9f27b8dc18c08f00627dec02359b46a24791dc3" - }, - "dist": { - "type": "zip", - "url": "https://github.com/fabpot/Pimple/zipball/b9f27b8dc18c08f00627dec02359b46a24791dc3", - "reference": "b9f27b8dc18c08f00627dec02359b46a24791dc3", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Pimple": "lib/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "dependency injection", - "container" - ], - "time": "1347278988" - }, - { - "name": "silex/silex", - "version": "dev-master", - "source": { - "type": "git", - "url": "git://github.com/fabpot/Silex.git", - "reference": "69d710011ee8f9fa286854fcf636a07ad76b570b" - }, - "dist": { - "type": "zip", - "url": "https://github.com/fabpot/Silex/zipball/69d710011ee8f9fa286854fcf636a07ad76b570b", - "reference": "69d710011ee8f9fa286854fcf636a07ad76b570b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "pimple/pimple": "1.*", - "symfony/event-dispatcher": ">=2.1,<2.3-dev", - "symfony/http-foundation": ">=2.1,<2.3-dev", - "symfony/http-kernel": ">=2.1,<2.3-dev", - "symfony/routing": ">=2.1,<2.3-dev" - }, - "require-dev": { - "monolog/monolog": ">=1.0.0,<1.2-dev", - "twig/twig": ">=1.8.0,<2.0-dev", - "swiftmailer/swiftmailer": "4.2.*", - "doctrine/dbal": ">=2.2.0,<2.4.0-dev", - "symfony/security": ">=2.1,<2.3-dev", - "symfony/config": ">=2.1,<2.3-dev", - "symfony/locale": ">=2.1,<2.3-dev", - "symfony/form": ">=2.1,<2.3-dev", - "symfony/browser-kit": ">=2.1,<2.3-dev", - "symfony/css-selector": ">=2.1,<2.3-dev", - "symfony/finder": ">=2.1,<2.3-dev", - "symfony/monolog-bridge": ">=2.1,<2.3-dev", - "symfony/process": ">=2.1,<2.3-dev", - "symfony/translation": ">=2.1,<2.3-dev", - "symfony/twig-bridge": ">=2.1,<2.3-dev", - "symfony/validator": ">=2.1,<2.3-dev", - "symfony/serializer": ">=2.1,<2.3-dev" - }, - "suggest": { - "symfony/browser-kit": ">=2.1,<2.3-dev", - "symfony/css-selector": ">=2.1,<2.3-dev", - "symfony/dom-crawler": ">=2.1,<2.3-dev" - }, - "time": "1351540898", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Silex": "src/" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - } - ], - "description": "The PHP micro-framework based on the Symfony2 Components", - "homepage": "http://silex.sensiolabs.org", - "keywords": [ - "microframework" - ] - }, - { - "name": "symfony/event-dispatcher", - "version": "dev-master", - "target-dir": "Symfony/Component/EventDispatcher", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher", - "reference": "24a1039d52b6b9f533cb73dcb96c7748262db686" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/EventDispatcher/zipball/24a1039d52b6b9f533cb73dcb96c7748262db686", - "reference": "24a1039d52b6b9f533cb73dcb96c7748262db686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/dependency-injection": "2.2.*" - }, - "suggest": { - "symfony/dependency-injection": "2.2.*", - "symfony/http-kernel": "2.2.*" - }, - "time": "1349553479", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/filesystem", - "version": "2.1.x-dev", - "target-dir": "Symfony/Component/Filesystem", - "source": { - "type": "git", - "url": "https://github.com/symfony/Filesystem", - "reference": "v2.1.3" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Filesystem/zipball/v2.1.3", - "reference": "v2.1.3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Filesystem": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "http://symfony.com", - "time": "1350717030" - }, - { - "name": "symfony/http-foundation", - "version": "dev-master", - "target-dir": "Symfony/Component/HttpFoundation", - "source": { - "type": "git", - "url": "https://github.com/symfony/HttpFoundation", - "reference": "707e289629a10fde825bc4ba90aba743f79b173c" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/HttpFoundation/zipball/707e289629a10fde825bc4ba90aba743f79b173c", - "reference": "707e289629a10fde825bc4ba90aba743f79b173c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "1351508251", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "classmap": [ - "Symfony/Component/HttpFoundation/Resources/stubs" - ] - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/http-kernel", - "version": "dev-master", - "target-dir": "Symfony/Component/HttpKernel", - "source": { - "type": "git", - "url": "https://github.com/symfony/HttpKernel", - "reference": "4dcb0bf602788342fb80c28c6e28be818839d417" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/HttpKernel/zipball/4dcb0bf602788342fb80c28c6e28be818839d417", - "reference": "4dcb0bf602788342fb80c28c6e28be818839d417", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/event-dispatcher": "2.2.*", - "symfony/http-foundation": "2.2.*" - }, - "require-dev": { - "symfony/browser-kit": "2.2.*", - "symfony/class-loader": "2.2.*", - "symfony/config": "2.2.*", - "symfony/console": "2.2.*", - "symfony/dependency-injection": "2.2.*", - "symfony/finder": "2.2.*", - "symfony/process": "2.2.*", - "symfony/routing": "2.2.*" - }, - "suggest": { - "symfony/browser-kit": "2.2.*", - "symfony/class-loader": "2.2.*", - "symfony/config": "2.2.*", - "symfony/console": "2.2.*", - "symfony/dependency-injection": "2.2.*", - "symfony/finder": "2.2.*" - }, - "time": "1351530455", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\HttpKernel\\": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony HttpKernel Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/process", - "version": "dev-master", - "target-dir": "Symfony/Component/Process", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process", - "reference": "b35a2a4fae02286df3275d7094a3d3d575122db8" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Process/zipball/b35a2a4fae02286df3275d7094a3d3d575122db8", - "reference": "b35a2a4fae02286df3275d7094a3d3d575122db8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Process\\": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "http://symfony.com", - "time": "1351356874" - }, - { - "name": "symfony/routing", - "version": "dev-master", - "target-dir": "Symfony/Component/Routing", - "source": { - "type": "git", - "url": "https://github.com/symfony/Routing", - "reference": "29792d8ac4ed7308acdeed4933cb6d91b7f6510f" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/Routing/zipball/29792d8ac4ed7308acdeed4933cb6d91b7f6510f", - "reference": "29792d8ac4ed7308acdeed4933cb6d91b7f6510f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "doctrine/common": ">=2.2,<2.4-dev", - "symfony/config": "2.2.*", - "symfony/yaml": "2.2.*", - "symfony/http-kernel": "2.2.*" - }, - "suggest": { - "doctrine/common": ">=2.2,<2.4-dev", - "symfony/config": "2.2.*", - "symfony/yaml": "2.2.*" - }, - "time": "1351466734", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Component\\Routing\\": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/twig-bridge", - "version": "2.1.x-dev", - "target-dir": "Symfony/Bridge/Twig", - "source": { - "type": "git", - "url": "https://github.com/symfony/TwigBridge", - "reference": "v2.1.3" - }, - "dist": { - "type": "zip", - "url": "https://github.com/symfony/TwigBridge/zipball/v2.1.3", - "reference": "v2.1.3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "twig/twig": ">=1.9.1,<2.0-dev" - }, - "require-dev": { - "symfony/form": "2.1.*", - "symfony/routing": "2.1.*", - "symfony/templating": "2.1.*", - "symfony/translation": "2.1.*", - "symfony/yaml": "2.1.*", - "symfony/security": "2.1.*" - }, - "suggest": { - "symfony/form": "2.1.*", - "symfony/routing": "2.1.*", - "symfony/templating": "2.1.*", - "symfony/translation": "2.1.*", - "symfony/yaml": "2.1.*", - "symfony/security": "2.1.*" - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-0": { - "Symfony\\Bridge\\Twig": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "Symfony Twig Bridge", - "homepage": "http://symfony.com", - "time": "1349363877" - }, - { - "name": "twig/twig", - "version": "v1.9.2", - "source": { - "type": "git", - "url": "git://github.com/fabpot/Twig.git", - "reference": "v1.9.2" - }, - "dist": { - "type": "zip", - "url": "https://github.com/fabpot/Twig/zipball/v1.9.2", - "reference": "v1.9.2", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "time": "2012-08-25 10:32:57", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "license": [ - "BSD-3" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - } - ], - "packages-dev": null, - "aliases": [ - - ], - "minimum-stability": "dev", - "stability-flags": { - "klaussilveira/gitter": 20 - } -} From 449e08e5193a5d1b1611ae32cce2d5e7240a11fe Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:38:27 -0200 Subject: [PATCH 12/27] fix #214 - rewrite rule in .htaccess points to root of document directory --- .htaccess | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index efb9407..b3e5da9 100644 --- a/.htaccess +++ b/.htaccess @@ -2,8 +2,10 @@ Options -MultiViews RewriteEngine On + #RewriteBase /path/to/gitlist/ + RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ /index.php [L,NC] + RewriteRule ^(.*)$ index.php [L,NC] order allow,deny From 78595be8eb565e1eeb0bdc66feaa7730955a2793 Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 20 Dec 2012 01:57:24 -0200 Subject: [PATCH 13/27] ops. fix my mistake, ignore env files of the composer correctly now --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index de5dac4..f949f6f 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ nbproject node_modules config.ini cache.properties -composer.* \ No newline at end of file +composer.phar +composer.lock \ No newline at end of file From efa30721925241d58a5bcd75e701b24d29e630d5 Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 20 Dec 2012 12:37:56 -0200 Subject: [PATCH 14/27] revert changes discussed on comments of PR #226 --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index f949f6f..e9b0612 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,3 @@ node_modules config.ini cache.properties composer.phar -composer.lock \ No newline at end of file From bc3a3634c5a8e92e5768d95095a31a672b7459ee Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 20 Dec 2012 12:46:37 -0200 Subject: [PATCH 15/27] undo delete of composer.lock --- composer.lock | 621 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 621 insertions(+) create mode 100644 composer.lock diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..77469ae --- /dev/null +++ b/composer.lock @@ -0,0 +1,621 @@ +{ + "hash": "b1fc3d7e61707618f68e5cf940e97081", + "packages": [ + { + "name": "klaussilveira/gitter", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/klaussilveira/gitter", + "reference": "1c9b6e4dde81d21acffe99d9f4559ed3bc59f947" + }, + "dist": { + "type": "zip", + "url": "https://github.com/klaussilveira/gitter/zipball/1c9b6e4dde81d21acffe99d9f4559ed3bc59f947", + "reference": "1c9b6e4dde81d21acffe99d9f4559ed3bc59f947", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/process": ">=2.1" + }, + "require-dev": { + "symfony/filesystem": ">=2.1" + }, + "time": "1351643953", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "Gitter": "lib/" + } + }, + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Klaus Silveira", + "email": "klaussilveira@php.net", + "homepage": "http://www.klaussilveira.com/", + "role": "Developer" + } + ], + "description": "Gitter allows you to interact in an object oriented manner with Git repositories.", + "homepage": "https://github.com/klaussilveira/gitter", + "keywords": [ + "git", + "vcs" + ] + }, + { + "name": "pimple/pimple", + "version": "dev-master", + "source": { + "type": "git", + "url": "git://github.com/fabpot/Pimple.git", + "reference": "b9f27b8dc18c08f00627dec02359b46a24791dc3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/fabpot/Pimple/zipball/b9f27b8dc18c08f00627dec02359b46a24791dc3", + "reference": "b9f27b8dc18c08f00627dec02359b46a24791dc3", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Pimple": "lib/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "dependency injection", + "container" + ], + "time": "1347278988" + }, + { + "name": "silex/silex", + "version": "dev-master", + "source": { + "type": "git", + "url": "git://github.com/fabpot/Silex.git", + "reference": "69d710011ee8f9fa286854fcf636a07ad76b570b" + }, + "dist": { + "type": "zip", + "url": "https://github.com/fabpot/Silex/zipball/69d710011ee8f9fa286854fcf636a07ad76b570b", + "reference": "69d710011ee8f9fa286854fcf636a07ad76b570b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "pimple/pimple": "1.*", + "symfony/event-dispatcher": ">=2.1,<2.3-dev", + "symfony/http-foundation": ">=2.1,<2.3-dev", + "symfony/http-kernel": ">=2.1,<2.3-dev", + "symfony/routing": ">=2.1,<2.3-dev" + }, + "require-dev": { + "monolog/monolog": ">=1.0.0,<1.2-dev", + "twig/twig": ">=1.8.0,<2.0-dev", + "swiftmailer/swiftmailer": "4.2.*", + "doctrine/dbal": ">=2.2.0,<2.4.0-dev", + "symfony/security": ">=2.1,<2.3-dev", + "symfony/config": ">=2.1,<2.3-dev", + "symfony/locale": ">=2.1,<2.3-dev", + "symfony/form": ">=2.1,<2.3-dev", + "symfony/browser-kit": ">=2.1,<2.3-dev", + "symfony/css-selector": ">=2.1,<2.3-dev", + "symfony/finder": ">=2.1,<2.3-dev", + "symfony/monolog-bridge": ">=2.1,<2.3-dev", + "symfony/process": ">=2.1,<2.3-dev", + "symfony/translation": ">=2.1,<2.3-dev", + "symfony/twig-bridge": ">=2.1,<2.3-dev", + "symfony/validator": ">=2.1,<2.3-dev", + "symfony/serializer": ">=2.1,<2.3-dev" + }, + "suggest": { + "symfony/browser-kit": ">=2.1,<2.3-dev", + "symfony/css-selector": ">=2.1,<2.3-dev", + "symfony/dom-crawler": ">=2.1,<2.3-dev" + }, + "time": "1351540898", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Silex": "src/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" + } + ], + "description": "The PHP micro-framework based on the Symfony2 Components", + "homepage": "http://silex.sensiolabs.org", + "keywords": [ + "microframework" + ] + }, + { + "name": "symfony/event-dispatcher", + "version": "dev-master", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher", + "reference": "24a1039d52b6b9f533cb73dcb96c7748262db686" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/EventDispatcher/zipball/24a1039d52b6b9f533cb73dcb96c7748262db686", + "reference": "24a1039d52b6b9f533cb73dcb96c7748262db686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "2.2.*" + }, + "suggest": { + "symfony/dependency-injection": "2.2.*", + "symfony/http-kernel": "2.2.*" + }, + "time": "1349553479", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/filesystem", + "version": "2.1.x-dev", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Filesystem/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "1350717030" + }, + { + "name": "symfony/http-foundation", + "version": "dev-master", + "target-dir": "Symfony/Component/HttpFoundation", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation", + "reference": "707e289629a10fde825bc4ba90aba743f79b173c" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/HttpFoundation/zipball/707e289629a10fde825bc4ba90aba743f79b173c", + "reference": "707e289629a10fde825bc4ba90aba743f79b173c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "1351508251", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Symfony/Component/HttpFoundation/Resources/stubs" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/http-kernel", + "version": "dev-master", + "target-dir": "Symfony/Component/HttpKernel", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel", + "reference": "4dcb0bf602788342fb80c28c6e28be818839d417" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/HttpKernel/zipball/4dcb0bf602788342fb80c28c6e28be818839d417", + "reference": "4dcb0bf602788342fb80c28c6e28be818839d417", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/event-dispatcher": "2.2.*", + "symfony/http-foundation": "2.2.*" + }, + "require-dev": { + "symfony/browser-kit": "2.2.*", + "symfony/class-loader": "2.2.*", + "symfony/config": "2.2.*", + "symfony/console": "2.2.*", + "symfony/dependency-injection": "2.2.*", + "symfony/finder": "2.2.*", + "symfony/process": "2.2.*", + "symfony/routing": "2.2.*" + }, + "suggest": { + "symfony/browser-kit": "2.2.*", + "symfony/class-loader": "2.2.*", + "symfony/config": "2.2.*", + "symfony/console": "2.2.*", + "symfony/dependency-injection": "2.2.*", + "symfony/finder": "2.2.*" + }, + "time": "1351530455", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel\\": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/process", + "version": "dev-master", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process", + "reference": "b35a2a4fae02286df3275d7094a3d3d575122db8" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Process/zipball/b35a2a4fae02286df3275d7094a3d3d575122db8", + "reference": "b35a2a4fae02286df3275d7094a3d3d575122db8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com", + "time": "1351356874" + }, + { + "name": "symfony/routing", + "version": "dev-master", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing", + "reference": "29792d8ac4ed7308acdeed4933cb6d91b7f6510f" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Routing/zipball/29792d8ac4ed7308acdeed4933cb6d91b7f6510f", + "reference": "29792d8ac4ed7308acdeed4933cb6d91b7f6510f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "doctrine/common": ">=2.2,<2.4-dev", + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*", + "symfony/http-kernel": "2.2.*" + }, + "suggest": { + "doctrine/common": ">=2.2,<2.4-dev", + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "time": "1351466734", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing\\": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/twig-bridge", + "version": "2.1.x-dev", + "target-dir": "Symfony/Bridge/Twig", + "source": { + "type": "git", + "url": "https://github.com/symfony/TwigBridge", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/TwigBridge/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "twig/twig": ">=1.9.1,<2.0-dev" + }, + "require-dev": { + "symfony/form": "2.1.*", + "symfony/routing": "2.1.*", + "symfony/templating": "2.1.*", + "symfony/translation": "2.1.*", + "symfony/yaml": "2.1.*", + "symfony/security": "2.1.*" + }, + "suggest": { + "symfony/form": "2.1.*", + "symfony/routing": "2.1.*", + "symfony/templating": "2.1.*", + "symfony/translation": "2.1.*", + "symfony/yaml": "2.1.*", + "symfony/security": "2.1.*" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Symfony\\Bridge\\Twig": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Twig Bridge", + "homepage": "http://symfony.com", + "time": "1349363877" + }, + { + "name": "twig/twig", + "version": "v1.9.2", + "source": { + "type": "git", + "url": "git://github.com/fabpot/Twig.git", + "reference": "v1.9.2" + }, + "dist": { + "type": "zip", + "url": "https://github.com/fabpot/Twig/zipball/v1.9.2", + "reference": "v1.9.2", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "time": "2012-08-25 10:32:57", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "license": [ + "BSD-3" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ] + } + ], + "packages-dev": null, + "aliases": [ + + ], + "minimum-stability": "dev", + "stability-flags": { + "klaussilveira/gitter": 20 + } +} \ No newline at end of file From 0951527bfc066aedfe4d90cb97b929e1afc25934 Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 20 Dec 2012 12:56:17 -0200 Subject: [PATCH 16/27] put escapeshelltag out of the string --- src/GitList/Git/Repository.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index 3d7a568..50d1f37 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -70,7 +70,8 @@ class Repository extends BaseRepository public function searchCommitLog($query) { - $command = "log --grep=".escapeshellarg($query)." --pretty=format:\"%H%h%T%P%an%ae%at%cn%ce%ct\""; + $query = escapeshellarg($query); + $command = "log --grep={$query} --pretty=format:\"%H%h%T%P%an%ae%at%cn%ce%ct\""; try { $logs = $this->getPrettyFormat($command); @@ -89,8 +90,10 @@ class Repository extends BaseRepository public function searchTree($query, $branch) { + $query = escapeshellarg($query); + try { - $results = $this->getClient()->run($this, "grep -I --line-number ".escapeshellarg($query)." $branch"); + $results = $this->getClient()->run($this, "grep -I --line-number {$query} $branch"); } catch (\RuntimeException $e) { return false; } From 1f8f321037b64944bb6deeab52cf5e791cf5d6d8 Mon Sep 17 00:00:00 2001 From: Nate Eagleson Date: Thu, 20 Dec 2012 22:22:47 -0500 Subject: [PATCH 17/27] Fix tests (and this time I tested it). Admittedly, I tested it by modifying composer.json to include phpunit but then did not commit that change, so it's vaguely possible an older phpunit would find a way to fail. I think we should be good, though. --- tests/InterfaceTest.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 0a600e8..99a97b9 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -80,12 +80,17 @@ class InterfaceTest extends WebTestCase $repository->checkout("master"); // master-less repository fixture - $git->createRepository(self::$tmpdir . 'masterless'); - $repository = $git->getRepository(self::$tmpdir . 'masterless'); + $git->createRepository(self::$tmpdir . 'develop'); + $repository = $git->getRepository(self::$tmpdir . '/develop'); + $repository->setConfig('user.name', 'Luke Skywalker'); + $repository->setConfig('user.email', 'luke@rebel.org'); + file_put_contents(self::$tmpdir . 'develop/README.md', "## develop\ndevelop is a *test* repository!"); + $repository->addAll(); + $repository->commit("First commit"); $repository->createBranch("develop"); $repository = $repository->checkout('develop'); - file_put_contents(self::$tmpdir . 'masterless/README.md', "## masterless\nmasterless is a *test* repository!"); - file_put_contents(self::$tmpdir . 'masterless/test.php', "setConfig('user.name', 'Luke Skywalker'); $repository->setConfig('user.email', 'luke@rebel.org'); $repository->addAll(); @@ -121,8 +126,8 @@ class InterfaceTest extends WebTestCase $this->assertEquals('/nested/NestedRepo/master/rss/', $crawler->filter('.repository-header a')->eq(3)->attr('href')); $this->assertCount(1, $crawler->filter('div.repository-header:contains("foobar")')); $this->assertCount(1, $crawler->filter('div.repository-body:contains("This is a test repo!")')); - $this->assertEquals('/foobar/', $crawler->filter('.repository-header a')->eq(4)->attr('href')); - $this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(5)->attr('href')); + $this->assertEquals('/foobar/', $crawler->filter('.repository-header a')->eq(6)->attr('href')); + $this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(7)->attr('href')); } public function testRepositoryPage() @@ -252,11 +257,11 @@ class InterfaceTest extends WebTestCase $this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent()); } - public function testMasterlessRepo() + public function testDevelopRepo() { $client = $this->createClient(); - $crawler = $client->request('GET', '/masterless/'); + $crawler = $client->request('GET', '/develop/'); $this->assertTrue($client->getResponse()->isOk()); } From 412c73c5092b1938bbed4b4fc7c5fd7b5dd28554 Mon Sep 17 00:00:00 2001 From: Vitaliy Ognev Date: Sun, 23 Dec 2012 14:01:26 +0200 Subject: [PATCH 18/27] fix situation when valid ref is a part of path --- src/GitList/Util/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index 80d783d..16c1b33 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -199,7 +199,7 @@ class Repository // Otherwise, attempt to detect the ref using a list of the project's branches and tags $valid_refs = array_merge((array) $repository->getBranches(), (array) $repository->getTags()); foreach ($valid_refs as $k => $v) { - if (!preg_match("#{$v}/#", $input)) { + if (!preg_match("#^{$v}/#", $input)) { unset($valid_refs[$k]); } } From 06f65ca8e2694a5ff832e77dc80b22d5249dd8fc Mon Sep 17 00:00:00 2001 From: Vitaliy Ognev Date: Sun, 23 Dec 2012 14:32:32 +0200 Subject: [PATCH 19/27] should take 1st match --- src/GitList/Util/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index 16c1b33..0236d14 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -207,7 +207,7 @@ class Repository // No exact ref match, so just try our best if (count($valid_refs) > 1) { preg_match('/([^\/]+)(.*)/', $input, $matches); - $branch = preg_replace('/^\/|\/$/', '', $matches[0]); + $branch = preg_replace('/^\/|\/$/', '', $matches[1]); } else { // Extract branch name $branch = array_shift($valid_refs); From 652af777aa03f1045b7170bfe1183e606f4ab072 Mon Sep 17 00:00:00 2001 From: Vitaliy Ognev Date: Sun, 23 Dec 2012 15:34:17 +0200 Subject: [PATCH 20/27] ensure ref name is encoded --- src/GitList/Util/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index 0236d14..5659125 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -199,7 +199,7 @@ class Repository // Otherwise, attempt to detect the ref using a list of the project's branches and tags $valid_refs = array_merge((array) $repository->getBranches(), (array) $repository->getTags()); foreach ($valid_refs as $k => $v) { - if (!preg_match("#^{$v}/#", $input)) { + if (!preg_match(sprintf("#^%s/#", preg_quote($v, '#')), $input)) { unset($valid_refs[$k]); } } From 9d341b59ab867feb4ecb8d55bb3cf9c40c6b5ead Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 3 Jan 2013 00:18:06 -0200 Subject: [PATCH 21/27] fix url generation - now a test to nested repositories (testInitialPage test) is passing on windows os. --- src/GitList/Util/Routing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Util/Routing.php b/src/GitList/Util/Routing.php index 884e251..d0a60ff 100644 --- a/src/GitList/Util/Routing.php +++ b/src/GitList/Util/Routing.php @@ -42,7 +42,7 @@ class Routing { if (strpos($repoPath, $this->app['git.repos']) === 0) { $relativePath = substr($repoPath, strlen($this->app['git.repos'])); - return ltrim($relativePath, '/'); + return ltrim(strtr($relativePath, '\\', '/'), '/'); } else { throw new \InvalidArgumentException( sprintf("Path '%s' does not match configured repository directory", $repoPath) From 40d18bb8250ff41964a7527fdb4acbfb835da04c Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 3 Jan 2013 00:22:48 -0200 Subject: [PATCH 22/27] fix html source code view --- src/GitList/Application.php | 1 + views/file.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GitList/Application.php b/src/GitList/Application.php index 7f7e2cd..99e97f8 100644 --- a/src/GitList/Application.php +++ b/src/GitList/Application.php @@ -48,6 +48,7 @@ class Application extends SilexApplication $this->register(new RoutingUtilServiceProvider()); $this['twig'] = $this->share($this->extend('twig', function($twig, $app) { + $twig->addFilter('htmlentities', new \Twig_Filter_Function('htmlentities')); $twig->addFilter('md5', new \Twig_Filter_Function('md5')); return $twig; diff --git a/views/file.twig b/views/file.twig index 8b530d2..71adbec 100644 --- a/views/file.twig +++ b/views/file.twig @@ -24,7 +24,7 @@
    {{ blob }}
    {% else %} -
    {{ blob }}
    +
    {{ blob|htmlentities|raw }}
    {% endif %}
    From 38d092c58b27aaff7c96bb1b4c706a7125dbe1af Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 3 Jan 2013 01:10:21 -0200 Subject: [PATCH 23/27] fix bugs on commit page - when get diff logs of a commit that is decendent of a merge or when a commit is the initial commit and fix a logical error on readDiffLogs method --- src/GitList/Git/Repository.php | 91 ++++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 3 deletions(-) diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index 50d1f37..32ae329 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -26,10 +26,12 @@ class Repository extends BaseRepository $data = $format->parse($logs[0]); $commit = new Commit; $commit->importData($data[0]); - unset($logs[0]); - if (empty($logs[1])) { - $logs = explode("\n", $this->getClient()->run($this, 'diff ' . $commitHash . '~1..' . $commitHash)); + if ($commit->getParentsHash()) { + $command = 'diff ' . $commitHash . '~1..' . $commitHash; + $logs = explode("\n", $this->getClient()->run($this, $command)); + } else { + $logs = array_slice($logs, 1); } $commit->setDiffs($this->readDiffLogs($logs)); @@ -37,6 +39,89 @@ class Repository extends BaseRepository return $commit; } + /** + * Read diff logs and generate a collection of diffs + * + * @param array $logs Array of log rows + * @return array Array of diffs + */ + public function readDiffLogs(array $logs) + { + $diffs = array(); + $lineNumOld = 0; + $lineNumNew = 0; + foreach ($logs as $log) { + if ('diff' === substr($log, 0, 4)) { + if (isset($diff)) { + $diffs[] = $diff; + } + + $diff = new Diff; + if (preg_match('/^diff --[\S]+ a\/?(.+) b\/?/', $log, $name)) { + $diff->setFile($name[1]); + } + continue; + } + + if ('index' === substr($log, 0, 5)) { + $diff->setIndex($log); + continue; + } + + if ('---' === substr($log, 0, 3)) { + $diff->setOld($log); + continue; + } + + if ('+++' === substr($log, 0, 3)) { + $diff->setNew($log); + continue; + } + + // Handle binary files properly. + if ('Binary' === substr($log, 0, 6)) { + $m = array(); + if (preg_match('/Binary files (.+) and (.+) differ/', $log, $m)) { + $diff->setOld($m[1]); + $diff->setNew(" {$m[2]}"); + } + } + + if (!empty($log)) { + switch ($log[0]) { + case "@": + // Set the line numbers + preg_match('/@@ -([0-9]+)/', $log, $matches); + $lineNumOld = $matches[1] - 1; + $lineNumNew = $matches[1] - 1; + break; + case "-": + $lineNumOld++; + break; + case "+": + $lineNumNew++; + break; + default: + $lineNumOld++; + $lineNumNew++; + } + } else { + $lineNumOld++; + $lineNumNew++; + } + + if (isset($diff)) { + $diff->addLine($log, $lineNumOld, $lineNumNew); + } + } + + if (isset($diff)) { + $diffs[] = $diff; + } + + return $diffs; + } + /** * Show the repository commit log with pagination * From cb5fe85d4f8e8a0bcbfda1d699cc8ecfc2571fcd Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 3 Jan 2013 00:40:16 -0200 Subject: [PATCH 24/27] improve get blame method retrieving long revisions to avoid ambiguity and omitting the caret of revisions (boundary commits) --- src/GitList/Controller/CommitController.php | 2 +- src/GitList/Git/Repository.php | 38 +++++++++++++++++++++ views/blame.twig | 2 +- views/commits_list.twig | 2 +- views/rss.twig | 2 +- 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/GitList/Controller/CommitController.php b/src/GitList/Controller/CommitController.php index 728b861..2597556 100644 --- a/src/GitList/Controller/CommitController.php +++ b/src/GitList/Controller/CommitController.php @@ -72,7 +72,7 @@ class CommitController implements ControllerProviderInterface ->assert('branch', '[\w-._\/]+') ->bind('searchcommits'); - $route->get('{repo}/commit/{commit}/', function($repo, $commit) use ($app) { + $route->get('{repo}/commit/{commit}', function($repo, $commit) use ($app) { $repository = $app['git']->getRepository($app['git.repos'] . $repo); $commit = $repository->getCommit($commit); diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index 50d1f37..edd399b 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -37,6 +37,44 @@ class Repository extends BaseRepository return $commit; } + /** + * Blames the provided file and parses the output + * + * @param string $file File that will be blamed + * @return array Commits hashes containing the lines + */ + public function getBlame($file) + { + $blame = array(); + $logs = $this->getClient()->run($this, "blame --root -sl $file"); + $logs = explode("\n", $logs); + + $i = 0; + $previousCommit = ''; + foreach ($logs as $log) { + if ($log == '') { + continue; + } + + preg_match_all("/([a-zA-Z0-9]{40})\s+.*?([0-9]+)\)(.+)/", $log, $match); + + $currentCommit = $match[1][0]; + if ($currentCommit != $previousCommit) { + ++$i; + $blame[$i] = array( + 'line' => '', + 'commit' => $currentCommit, + 'commitShort' => substr($currentCommit, 0, 8) + ); + } + + $blame[$i]['line'] .= PHP_EOL . $match[3][0]; + $previousCommit = $currentCommit; + } + + return $blame; + } + /** * Show the repository commit log with pagination * diff --git a/views/blame.twig b/views/blame.twig index 039de5c..d58d918 100644 --- a/views/blame.twig +++ b/views/blame.twig @@ -14,7 +14,7 @@ {% for blame in blames %} - + {% endfor %} diff --git a/views/commits_list.twig b/views/commits_list.twig index cdab179..dbc6eec 100644 --- a/views/commits_list.twig +++ b/views/commits_list.twig @@ -11,7 +11,7 @@ diff --git a/views/rss.twig b/views/rss.twig index aca671f..e14e783 100644 --- a/views/rss.twig +++ b/views/rss.twig @@ -9,7 +9,7 @@ {{ commit.message }} {{ commit.author.name }} authored {{ commit.shortHash }} in {{ commit.date | date('d/m/Y \\a\\t H:i:s') }} - {{ path('commit', {repo: repo, commit: commit.shortHash}) }} + {{ path('commit', {repo: repo, commit: commit.hash}) }} {{ commit.date | date('r') }} {% endfor %} From 2625beb393e699b46aa1edbde8eca98c89d3240f Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Thu, 17 Jan 2013 14:41:25 -0200 Subject: [PATCH 25/27] Fixed failing tests due to trailing backslash in URL --- tests/InterfaceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 99a97b9..6d8c85e 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -188,12 +188,12 @@ class InterfaceTest extends WebTestCase $crawler = $client->request('GET', '/GitTest/blame/master/test.php'); $this->assertTrue($client->getResponse()->isOk()); $this->assertCount(1, $crawler->filter('.source-header .meta:contains("test.php")')); - $this->assertRegexp('/\/GitTest\/commit\/[a-zA-Z0-9%]+\//', $crawler->filter('.blame-view .commit')->eq(0)->filter('a')->attr('href')); + $this->assertRegexp('/\/GitTest\/commit\/[a-zA-Z0-9%]+/', $crawler->filter('.blame-view .commit')->eq(0)->filter('a')->attr('href')); $crawler = $client->request('GET', '/foobar/blame/master/bar.json'); $this->assertTrue($client->getResponse()->isOk()); $this->assertCount(1, $crawler->filter('.source-header .meta:contains("bar.json")')); - $this->assertRegexp('/\/foobar\/commit\/[a-zA-Z0-9%]+\//', $crawler->filter('.blame-view .commit')->eq(0)->filter('a')->attr('href')); + $this->assertRegexp('/\/foobar\/commit\/[a-zA-Z0-9%]+/', $crawler->filter('.blame-view .commit')->eq(0)->filter('a')->attr('href')); } public function testHistoryPage() From 14420d4380b43c7b1d3c7575ac4a414b5f1038aa Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Thu, 17 Jan 2013 15:50:41 -0200 Subject: [PATCH 26/27] Missing namespace declaration --- src/GitList/Git/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index cab2cdf..57c6095 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -4,12 +4,12 @@ namespace GitList\Git; use Gitter\Repository as BaseRepository; use Gitter\Model\Commit\Commit; +use Gitter\Model\Commit\Diff; use Gitter\PrettyFormat; use Symfony\Component\Filesystem\Filesystem; class Repository extends BaseRepository { - /** * Show the data from a specific commit * From ab7ffc181b3d27a13e908a4e2b331a085b09f70b Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Fri, 18 Jan 2013 13:34:29 -0200 Subject: [PATCH 27/27] Fixes #208 --- src/GitList/Util/Repository.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index 206c757..4ab0202 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -200,25 +200,23 @@ class Repository $branch = $matches[1]; } else { // Otherwise, attempt to detect the ref using a list of the project's branches and tags - $valid_refs = array_merge((array) $repository->getBranches(), (array) $repository->getTags()); - foreach ($valid_refs as $k => $v) { - if (!preg_match(sprintf("#^%s/#", preg_quote($v, '#')), $input)) { - unset($valid_refs[$k]); + $validRefs = array_merge((array) $repository->getBranches(), (array) $repository->getTags()); + foreach ($validRefs as $key => $ref) { + if (!preg_match(sprintf("#^%s/#", preg_quote($ref, '#')), $input)) { + unset($validRefs[$key]); } } // No exact ref match, so just try our best - if (count($valid_refs) > 1) { + if (count($validRefs) > 1) { preg_match('/([^\/]+)(.*)/', $input, $matches); $branch = preg_replace('/^\/|\/$/', '', $matches[1]); } else { // Extract branch name - $branch = array_shift($valid_refs); + $branch = array_shift($validRefs); } } - $tree = trim(str_replace($branch, "", $input), "/"); - return array($branch, $tree); }
    {{ blame.commit }}{{ blame.commitShort }}
    {{ blame.line }}
    - View {{ item.shortHash }} + View {{ item.shortHash }}

    {{ item.message }}

    {{ item.author.name }} authored in {{ item.date | date('d/m/Y \\a\\t H:i:s') }}