The Git Backend can be used to retrieve and view commit information. The commit information can either be retreived automatically through the use of the xgit scripts or using the fetch now link on the project administration repository page. The logs are then defaultly avaliable through the commitlog page.
Information reguarding the setup of xgit scripts is aviable in the README.txt located in the xgit directory.
If you have any questions, comments, or feature requests please visit the module page and post your concerns in the issue quene.
'; } return $output; } /** * Implementation of hook_versioncontrol_backends(). */ function versioncontrol_git_versioncontrol_backends() { return array( // The array key is up to 8 characters long, and used as unique identifier // for this VCS, in functions, URLs and in the database. 'git' => array( // The user-visible name of the VCS. 'name' => 'Git', // A short description of the VCS, if possible not longer than one or two sentences. 'description' => t('Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.'), // A list of optional capabilities, in addition to the required retrieval // of detailed commit information. 'capabilities' => array( // Use the commit hash for to identify the commit instead of an idvidual // revision for each file. VERSIONCONTROL_CAPABILITY_ATOMIC_COMMITS ), // An array listing which tables should be managed by Version Control API // instead of doing it manually in the backend. 'flags' => array( // versioncontrol_insert_repository() will automatically insert // array elements from $repository['git_specific'] into // {versioncontrol_git_repositories} and versioncontrol_get_repositories() // will automatically fetch it from there. VERSIONCONTROL_FLAG_AUTOADD_REPOSITORIES, ), ), ); } /** * Implementation of hook_menu(). */ function versioncontrol_git_menu() { $items = array(); $items['admin/project/versioncontrol-repositories/clearlock/git'] = array( 'title' => 'Clear lock', 'page callback' => 'versioncontrol_git_clearlock_repository_callback', 'access arguments' => array('administer version control systems'), 'type' => MENU_CALLBACK, ); $items['admin/project/versioncontrol-repositories/update/git'] = array( 'title' => 'Fetch log', 'page callback' => 'versioncontrol_git_update_repository_callback', 'access arguments' => array('administer version control systems'), 'type' => MENU_CALLBACK, ); return $items; } /** * Implementation of hook_cron() */ function versioncontrol_git_cron() { // get repositories that have log fetching enabled $result = db_query("SELECT repo_id FROM {versioncontrol_git_repositories} WHERE update_method = %d", VERSIONCONTROL_GIT_UPDATE_CRON); // Set timeout limit to 3600 seconds as it can take a long time to process // the log initially. (And hook_cron() might be called by poormanscron.) if (!ini_get('safe_mode')) { set_time_limit(3600); } while ($repo = db_fetch_object($result)) { $repository = versioncontrol_get_repository($repo->repo_id); if (isset($repository)) { _versioncontrol_git_update_repository($repository); } } } /** * Implementation of hook_get_selected_label_from_operation(). */ function versioncontrol_git_get_selected_label_from_operation($operation, $target_item) { // TODO: implement tag support here, tags>branch? // better not, after looking it again current code is OK. // just take the first branch, dunno what else we should do here... // jpetso knows neither :P return $operation['labels'][0]; } function _versioncontrol_git_get_branch_intersect($repository, $item1, $item2) { $constraints = array( 'revisions' => array($item1['revision'], $item2['revision']), 'vcs' => array('git'), 'repo_ids' => array($repository['repo_id']), 'types' => array(VERSIONCONTROL_OPERATION_COMMIT) ); $commit_ops = versioncontrol_get_operations($constraints); $branches1 = array(); $branches2 = array(); foreach ($commit_ops as $vc_op_id => $op) { foreach ($op['labels'] as $label) { if ($label['type'] === VERSIONCONTROL_OPERATION_BRANCH) { if ($op['revision'] == $item1['revision']) { $branches1[]=$label; } else if ($op['revision'] == $item2['revision']) { $branches2[]=$label; } } } } $branches = array_intersect($branches1, $branches2); return array_pop($branches); // We don't know any keys in $branches, so we use array_pop here. Also it'll return NULL if needed } /** * Implementation of hook_get_selected_label_from_other_item(). */ function versioncontrol_git_get_selected_label_from_other_item($repository, $target_item, &$other_item, $other_item_tags = array()) { // First up, optimizations - maybe we can do without the generic // "label transfer" code from further down and use assumptions instead. // Let's assume for FakeVCS repositories that if an item wears a label, then // an item at another path but with the same (file-level) revision can also // wear that same label. That is the case with some version control systems // (e.g. Git, Mercurial, Bazaar) but might not be the case with others // (CVS for its lack of global revision identifiers, SVN for its use of // directory structure as tag/branch identifiers). if ($target_item['revision'] == $other_item['revision']) { return versioncontrol_get_item_selected_label($repository, $other_item); } //can be maybe optimized for speed by using the hints provided return _versioncontrol_git_get_branch_intersect($repository, $target_item, $other_item); } /** * Implementation of hook_account_username_suggestion(). */ function versioncontrol_git_account_username_suggestion($repository, $user) { // @TODO: adjust later // Use the kindof standard git identifier here, it's nothing too serious. return $user->name ." <$user->mail>"; } /** * Implementation of hook_is_account_username_valid(). */ function versioncontrol_git_is_account_username_valid($repository, &$username) { // @TODO: adjust, too // We want to allow "prename name