diff --git a/CHANGELOG.txt b/CHANGELOG.txt new file mode 100644 index 0000000..4893a25 --- /dev/null +++ b/CHANGELOG.txt @@ -0,0 +1,24 @@ +Project Git instructions 6.x-1.x, 2011-04-20 +- Default direction updates + * Issue #1128070 by eliza411: Fixed Update Git instructions to include only the basic patch recommendation + +Project Git instructions 6.x-1.x, 2011-03-24 +-------------------------------------------- +- Default direction updates + * Issue #1080860: Updated commit message directions to explicitly recommend against starting messages with #. + * Issue #1092226: Updated command for creating patches from git format-patch to git diff + * Issue #1104302: Added directions for applying patches and abandoning local changes. + +Project Git instructions 6.x-1.x, 2011-xx-xx +-------------------------------------------- +- Default direction updates + * Issue #1075982 by helmo, David_Rothstein: Fixed 'Troubleshooting Git clone' link does not appear for projects you maintain. + +- Module updates + * Issue #1074220 by EclipseGc, helmo: Fixed Numerically Named Branches can result in bad instructions. + * Issue #1073394 by drumm: Set project breadcrumb. + +Project Git instructions 6.x-1.0, 2011-02-24 +-------------------------------------------- +* Initial release +* This release marks the transition of drupal.org to Git. diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..da6afee --- /dev/null +++ b/README.txt @@ -0,0 +1,10 @@ +Project Git Instructions +------------------------ + +This module adds the "Git instructions" tab to certian pages on Drupal.org. This includes modules, themes and installation profiles. + +This modules is specifically build for use on drupal.org. + +If you are hosting Git repositories yourself and make use of the versioncontrol API modules in drupal then maybe this module can be of service. It has however not been extensively tested on other installations. + +See: http://drupal.org/project/project_git_instructions diff --git a/project_git_instructions.module b/project_git_instructions.module index b38f1d2..1119d96 100644 --- a/project_git_instructions.module +++ b/project_git_instructions.module @@ -34,12 +34,12 @@ function project_git_instructions_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { if ($node->type == 'project_project') { $src = 'node/' . $node->nid . '/git-instructions'; if ($op == 'delete') { - db_query('DELETE FROM {url_alias} WHERE src = "%s"', $src); + db_query("DELETE FROM {url_alias} WHERE src = '%s'", $src); } elseif (($op == 'update' || $op == 'insert') && !empty($node->project['uri'])) { $dst = 'project/' . drupal_urlencode($node->project['uri']) . '/git-instructions'; - db_query('DELETE FROM {url_alias} WHERE src = "%s"', $src); - db_query('INSERT INTO {url_alias} (src, dst) VALUES ("%s", "%s")', $src, $dst); + db_query("DELETE FROM {url_alias} WHERE src = '%s'", $src); + db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", $src, $dst); } elseif ($op == 'view' && $a4) { if ($node->project['sandbox']) { @@ -89,16 +89,17 @@ function project_git_instructions_visibility($node) { * @return array Default replacements formatted for t(). */ function project_git_instructions_get_defaults($node, $version = NULL) { - global $user; + project_project_set_breadcrumb($node, TRUE); + $project_url_name = check_plain(drupal_urlencode($node->project['uri'] . '.git')); // Make the most common set of default replacement variables we can. $defaults = array('@project_name' => $project_url_name, '@uri' => $node->project['uri'], '%title' => $node->title, - '@project_fullname' => strtr(drupal_strtolower($node->title), array(' ' => '_')) + '@project_fullname' => preg_replace('#\W#', '_', drupal_strtolower($node->title)), ); if ($version) { $defaults['@branch'] = check_plain($version); @@ -141,7 +142,6 @@ function project_git_instructions_get_defaults($node, $version = NULL) { * Produce html code for the instructions tab. */ function project_git_instructions_project_tab($node, $version = NULL, $do_nonmaintainer = NULL) { - global $user; if (empty($node->versioncontrol_project['repo']->vcs)) { @@ -362,15 +362,22 @@ function project_git_instructions_project_promote_sandbox($project) { */ function project_git_instructions_maintainer() { $default = << +