Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know almost nothing on Drupal patches but it is important for me to ask this for others and myself: Why almost every Drupal patch I've seen in discussions in Drupal.org has a long complicated file name? For example, I've seen this one yesterday:

[Add_rtl_support]-[2635832]-[1].patch

Why is the []-[]-[] structure, why 3 words in the first structure(?), what is the medium-number, and what is the 1 (first patch release from the same committer)?

Two more examples, which are different from the above and one from another:

  • metatag_by_path_consequences_fix-2184979-12.patch
  • metatag-n2564483-190.interdiff.txt

And there could be more I guess...

I would thank any experienced dev who could shed some light in this context...

And also a subtle question: If I download a file with a long name and than changed the name to something like "fix1.patch" just for navigation comfortability, Will it still work as normal as it should have been?

share|improve this question
    
If you type git apply -v met and then click the TAB button on your keyboard, it will auto complete the name for you as long as there is other file that starts with met. If there is, just keep typing to the part that is different and then hit TAB. – No Sssweat Jan 7 at 9:17
up vote 16 down vote accepted

It just provide good information about the patch.

Here is the proper way to name a patch

[project_name]-[short-description]-[issue-number]-[comment-number].patch

Why? Here is a list of why these name are useful...

  • [project_name] - We use the project name to distinct the patch from other projects. Sometimes some project have multiples sub-modules and it just nice to have a name in front of the patch.

  • [short-description] - This is just a well practice from git, which is adding a small description about the patch.

  • [issue-number] - With unique issue number we can make sure what this patch is trying to solve because we can visit drupal.org/node/[issue-number] and see what is trying to solve.

  • [comment-number] Usually, there are multiple patch in the same issue queue and we need way to distinct different patch for this reason we add the comment-number so we do not get confuse when we are reviewing patches.

For more information about patches naming visit - Making a Drupal patch with Git

And also a subtle question: If I download a file with a long name and than changed the name to something like "fix1.patch" just for navigation comfortability, Will it still work as normal as it should have been?

Patches names does not have any affect to the patch content. This been said, it will work, it just that developer was very lazy and did not want to name it the proper way (or he/she did not know how to in Drupal we name patches).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.