private function countLogs($installed = true, $upcoming = false, $search = null)
	{
		$total     = 0;
		$countArgs = array('--count');

		if (isset($search))
		{
			$countArgs[] = '-i';
			$countArgs[] = '--grep=' . escapeshellarg($search);
		}

		if ($installed)
		{
			$installedArgs = $countArgs;
			array_unshift($installedArgs, 'HEAD');
			$total = $this->call('rev-list', $installedArgs);
			$total = trim($total);
		}

		if ($upcoming)
		{
			$upcomingArgs = $countArgs;
			array_unshift($upcomingArgs, "HEAD..{$this->upstream}");
			$upcomingTotal = $this->call('rev-list', $upcomingArgs);
			$upcomingTotal = trim($upcomingTotal);
			$total += $upcomingTotal;
		}

		return trim($total);
	}