Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to ignore specific patches from dependencies #62

Merged
merged 1 commit into from Sep 12, 2016

Conversation

mortenson
Copy link

@mortenson mortenson commented Aug 1, 2016

This PR adds a new feature, "patches-ignore", which allows a Composer package to ignore specific patches from dependencies. There are a number of use cases for the composer-patches project that this enhances:

  1. I use a different more recent version of a dependency, and now a patch isn't applying.
  2. I have a more up to date patch than my dependency, and want to use mine instead of theirs.
  3. A dependency's patch adds a feature to a project that I don't need.
  4. My patches conflict with a dependency's patches.

This is also a critical feature for Drupal distributions that require other distributions, as distributions typically contain loads of patches for Drupal modules. For the "child" distribution, using a different version of a module means that parent patches will not apply, which could break the build or cause unintended consequences. With this feature, a child distribution could ignore a patch that applied to an older version of a dependency, use a newer version of that dependency, and add a newer patch that applies cleanly.

Here's an example composer.json I wrote which requires the Lightning distribution for Drupal, and ignores a patch which adds a feature that conflicts with an edge case in our distribution (Demo Framework). This is use case 3 mentioned above:

{
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "composer",
      "url": "https://packagist.drupal-composer.org"
    },
    {
      "type": "vcs",
      "url": "https://github.com/mortenson/composer-patches"
    }
  ],
  "require": {
    "drupal/lightning": "dev-8.x-1.x",
    "cweagans/composer-patches": "dev-master as 1.5.0"
  },
  "extra": {
    "patches-ignore": {
      "drupal/lightning": {
        "drupal/panelizer": {
          "This patch has known conflicts with our Quick Edit integration": "https://www.drupal.org/files/issues/2664682-49.patch"
        }
      }
    }
  }
}

…ages, in case they want to provide a conflicting patch.
@grasmash
Copy link
Contributor

Great feature, we also need the ability to do this.

Pinging @cweagans for visibility.

@cweagans
Copy link
Owner

@mortenson @grasmash Sorry for the slow response here. 👍 from me.

@cweagans cweagans merged commit 65af213 into cweagans:master Sep 12, 2016
@mariagwyn
Copy link
Contributor

Any chance this can be documented in the README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants