When using a patch generated by following instructions from the More advanced patch contributor guide, drush_make fails to apply it.

According to comments in this guide, drush_make expects patches to be compatible withpatch -p0, but the instructions are for patch -p1 compatible patches.

The guide recommend patch to be compatible with patch -p1 or git apply<code>. According the a comment on the guide, the Drupal.org testbot try <code>patch -p1 then patch -p0.

Comments

cyberwolf’s picture

q0rban’s picture

Yeah, I don't think drush_make uses git apply yet for patches. It should probably be default behavior for download type == git.

q0rban’s picture

Status: Active » Needs work
StatusFileSize
new1.12 KB

Hmm, I tried to get the first half of this working (ie, using git apply if the download method was git). Unfortunately it seems like drush_make is deleting the .git directory right before I call git apply. Here's where I got.

q0rban’s picture

Status: Needs work » Needs review
StatusFileSize
new3.18 KB

Ok, here's an updated patch. Please test it out! From README.txt:

  One or more patches to apply to this project. An array of URLs from which
  each patch should be retrieved. By default, this assumes patch should be
  executed with the -p1 option (see http://drupal.org/patch/create and
  http://groups.drupal.org/node/140204). You may specify different options
  using the options array on the patch. These options can either be a single
  string, or an array of options.

        projects[calendar][patch][rfc-fixes][url] = "http://drupal.org/files/issues/cal-760316-rfc-fixes-2.diff"
        projects[calendar][patch][rfc-fixes][md5] = "e4876228f449cb0c37ffa0f2142"

       ; -p1 will be used by default, but this diff was created using -p0
        projects[calendar][patch][rfc-fixes][options] = "-p0"
        ; Alternately, you can specify an array of patch command options.
        projects[calendar][patch][rfc-fixes][options][] = "-p0"
        projects[calendar][patch][rfc-fixes][options][] = "-f"
izmeez’s picture

subscribing

danepowell’s picture

Status: Needs review » Closed (duplicate)

I'm quite sure this is a duplicate of #745224: Apply patches from git diff and git format-patch, correct me if I'm wrong