Venta al detalle, informática, impresoras, usb, pen, discos duros... Los mejores precios de la provincia de Tarragona!
Visítanos:
Para precios, comparativas y mucho más:
Almost all improvements to other peoples' projects come in the form of a self-contained set of changes, e.g., a bug fix against a particular module or include file, improvements to existing code, and so on. The exact changes are captured in a patch file — a simple text format that shows lines added and removed.
This page describes an advanced workflow that can help maintainers give you credit in the repository log by creating and uploading a patch containing instructions for one single commit to a project hosted on Drupal.org. For the general high-level overview of patching with git, see Making a patch with Git.
Prerequisite: Every workflow requires the initial set up detailed in Using Git on Drupal.org.
git clone --branch [version] http://git.drupal.org/project/[project_name].gitgit checkout [version]
git pullhttp://drupal.org/node/123456 then the issue number is 123456.)
git branch [issue-number]-[short-description] # e.g. 123456-example-bug
git checkout [issue-number]-[short-description]Or in a single line:
git checkout -b [issue-number]-[short-description] # e.g. 123456-example-bug# Edit file in your favorite editor:
<your_editor_here> [filename]
# After making your edits and saving the file, confirm your changes are present:
git status
# Make more edits in other files and save theme:
<your_editor_here> [other-filename]
# Confirm changes again:
git status
-a option.
# Commit the changes to your topic branch
git commit -a -m "Issue #123456: Fixed all instances of foo bug."See the Drupal.org documentation on commit messages for more details on commit message standards.
git fetch origingit rebase origin/[version] #e.g. [version] could be 7.x-2.xgit diff origin/[version] > [project_name]-[short-description]-[issue-number]-[comment-number].patchgit format-patch origin/[version] --stdout > [project_name]-[short-description]-[issue-number]-[comment-number].patchThe (unofficial) patch naming convention that has emerged from the community is:
[project_name]-[short-description]-[issue-number]-[comment-number].patch[project_name][short-description][issue-number]http://drupal.org/node/9876543, the issue number is 9876543.[comment-number]
A patch for a spelling error on the contributed module "my_module" and a suggested fix in comment #12 of issue #9876543 might look like: my_module-spelling-9876543-12.patch.
-DX at the end of the patch name will cause the testbot to skip testing of the patch. For example, my_module-spelling-9876543-13-D7.patch will be ignored.patch -p1 or git apply.git rebase -i to squash their several commits into one if it's only one logical commit.drupal-proper-title-987654321-23.patch. Please note that while some people opt to leave off the [project_name] from core patches, adding "drupal-" to the front helps distinguish core patches from others, and is therefore still recommended for consistency, clarity, and simplifying the instructions.format-patch command with the -C and -M options will move the file, instead of removing and adding the lines. The patch size becomes much smaller as a result of this.
git format-patch -C -M [version] --stdout > [patch-name].patch
git format-patch to create patches and you post them to Drupal.org, then the email and name you have configured in user.email and user.name will be widely indexed on the Internet, as Google picks up all our patches. If you don't want this, you may want to consider using the alternate git diff <main_branch> >/tmp/my_module.my_issue.patch method for creating patches.git add, avoid use of the -N option, which causes any resulting patches to try to apply against a non-existent file.*.patch to a ~/.gitignore file, followed by the command: git config --global core.excludesfile ~/.gitignore. You can also use this for other types of files that Git should always ignored, like text editor backup files. For more information, see: gitignore Manual Page.