prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  commit-msg stage does not work
  Everything works as expected when running just `pre-commit install`, then hooks work.
  But when running `pre-commit install -t commit-msg` `IOError` happens, since template could not be found.
  
  Here's the detailed information.
  
  ## Env
  
  - `python2.7`
  - `pipenv 7.3.7`
  - `pre-commit 1.1.1`
  
  Actually tested with both `python2` and `python3`.
  
  ## Configuration
  
  ```yaml
  - repo: local
    hooks:
      - id: gitlint
        name: gitlint
        entry: "bash -c 'gitlint lint'"
        language: system
        stages: [commit-msg]
  
      - id: pytest
        name: pytest
        entry: "bash -c 'python manage.py test'"
        language: system
  
      - id: safety
        name: safety
        entry: "bash -c 'safety check'"
        language: system
  ```
  
  ## Output
  
  ```
  » pre-commit install -t commit-msg
  Running in migration mode with existing hooks at /Users/sobolev/Desktop/test/.git/hooks/commit-msg.legacy
  Use -f to use only pre-commit.
  An unexpected error has occurred: IOError: [Errno 2] No such file or directory: '/Users/sobolev/.virtualenvs/test-p4WySO70/lib/python2.7/site-packages/pre_commit/resources/commit-msg-tmpl'
  Check the log at /Users/sobolev/.cache/pre-commit/pre-commit.log
  ```
  
  When I do `ls /Users/sobolev/.virtualenvs/test-p4WySO70/lib/python2.7/site-packages/pre_commit/resources/commit-msg-tmpl`  that's what is see:
  
  ```
  (test-p4WySO70) ~/Desktop/test  master ✗                                  ✚ 2 ⚡
  » ls /Users/sobolev/.virtualenvs/test-p4WySO70/lib/python2.7/site-packages/pre_commit/resources                
  empty_template  pre-push-tmpl  ruby-build.tar.gz
  hook-tmpl       rbenv.tar.gz   ruby-download.tar.gz
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 from setuptools import find_packages
  2 from setuptools import setup
  3 
  4 
  5 setup(
  6     name='pre_commit',
  7     description=(
  8         'A framework for managing and maintaining multi-language pre-commit '
  9         'hooks.'
  10     ),
  11     url='https://github.com/pre-commit/pre-commit',
  12     version='1.1.1',
  13 
  14     author='Anthony Sottile',
  15     author_email='asottile@umich.edu',
  16 
  17     platforms='linux',
  18     classifiers=[
  19         'License :: OSI Approved :: MIT License',
  20         'Programming Language :: Python :: 2',
  21         'Programming Language :: Python :: 2.7',
  22         'Programming Language :: Python :: 3',
  23         'Programming Language :: Python :: 3.5',
  24         'Programming Language :: Python :: 3.6',
  25         'Programming Language :: Python :: Implementation :: CPython',
  26         'Programming Language :: Python :: Implementation :: PyPy',
  27     ],
  28 
  29     packages=find_packages(exclude=('tests*', 'testing*')),
  30     package_data={
  31         'pre_commit': [
  32             'resources/hook-tmpl',
  33             'resources/pre-push-tmpl',
  34             'resources/rbenv.tar.gz',
  35             'resources/ruby-build.tar.gz',
  36             'resources/ruby-download.tar.gz',
  37             'resources/empty_template/*',
  38             'resources/empty_template/.npmignore',
  39         ],
  40     },
  41     install_requires=[
  42         'aspy.yaml',
  43         'cached-property',
  44         'identify>=1.0.0',
  45         'nodeenv>=0.11.1',
  46         'pyyaml',
  47         'six',
  48         'virtualenv',
  49     ],
  50     entry_points={
  51         'console_scripts': [
  52             'pre-commit = pre_commit.main:main',
  53             'pre-commit-validate-config = pre_commit.clientlib:validate_config_main',  # noqa
  54             'pre-commit-validate-manifest = pre_commit.clientlib:validate_manifest_main',  # noqa
  55         ],
  56     },
  57 )
  58
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -29,11 +29,7 @@
       packages=find_packages(exclude=('tests*', 'testing*')),
       package_data={
           'pre_commit': [
  -            'resources/hook-tmpl',
  -            'resources/pre-push-tmpl',
  -            'resources/rbenv.tar.gz',
  -            'resources/ruby-build.tar.gz',
  -            'resources/ruby-download.tar.gz',
  +            'resources/*',
               'resources/empty_template/*',
               'resources/empty_template/.npmignore',
           ],
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -29,11 +29,7 @@\n     packages=find_packages(exclude=('tests*', 'testing*')),\n     package_data={\n         'pre_commit': [\n-            'resources/hook-tmpl',\n-            'resources/pre-push-tmpl',\n-            'resources/rbenv.tar.gz',\n-            'resources/ruby-build.tar.gz',\n-            'resources/ruby-download.tar.gz',\n+            'resources/*',\n             'resources/empty_template/*',\n             'resources/empty_template/.npmignore',\n         ],\n", "issue": "commit-msg stage does not work\nEverything works as expected when running just `pre-commit install`, then hooks work.\r\nBut when running `pre-commit install -t commit-msg` `IOError` happens, since template could not be found.\r\n\r\nHere's the detailed information.\r\n\r\n## Env\r\n\r\n- `python2.7`\r\n- `pipenv 7.3.7`\r\n- `pre-commit 1.1.1`\r\n\r\nActually tested with both `python2` and `python3`.\r\n\r\n## Configuration\r\n\r\n```yaml\r\n- repo: local\r\n  hooks:\r\n    - id: gitlint\r\n      name: gitlint\r\n      entry: \"bash -c 'gitlint lint'\"\r\n      language: system\r\n      stages: [commit-msg]\r\n\r\n    - id: pytest\r\n      name: pytest\r\n      entry: \"bash -c 'python manage.py test'\"\r\n      language: system\r\n\r\n    - id: safety\r\n      name: safety\r\n      entry: \"bash -c 'safety check'\"\r\n      language: system\r\n```\r\n\r\n## Output\r\n\r\n```\r\n\u00bb pre-commit install -t commit-msg\r\nRunning in migration mode with existing hooks at /Users/sobolev/Desktop/test/.git/hooks/commit-msg.legacy\r\nUse -f to use only pre-commit.\r\nAn unexpected error has occurred: IOError: [Errno 2] No such file or directory: '/Users/sobolev/.virtualenvs/test-p4WySO70/lib/python2.7/site-packages/pre_commit/resources/commit-msg-tmpl'\r\nCheck the log at /Users/sobolev/.cache/pre-commit/pre-commit.log\r\n```\r\n\r\nWhen I do `ls /Users/sobolev/.virtualenvs/test-p4WySO70/lib/python2.7/site-packages/pre_commit/resources/commit-msg-tmpl`  that's what is see:\r\n\r\n```\r\n(test-p4WySO70) ~/Desktop/test  master \u2717                                  \u271a 2 \u26a1\r\n\u00bb ls /Users/sobolev/.virtualenvs/test-p4WySO70/lib/python2.7/site-packages/pre_commit/resources                \r\nempty_template  pre-push-tmpl  ruby-build.tar.gz\r\nhook-tmpl       rbenv.tar.gz   ruby-download.tar.gz\r\n```\n", "before_files": [{"content": "from setuptools import find_packages\nfrom setuptools import setup\n\n\nsetup(\n    name='pre_commit',\n    description=(\n        'A framework for managing and maintaining multi-language pre-commit '\n        'hooks.'\n    ),\n    url='https://github.com/pre-commit/pre-commit',\n    version='1.1.1',\n\n    author='Anthony Sottile',\n    author_email='asottile@umich.edu',\n\n    platforms='linux',\n    classifiers=[\n        'License :: OSI Approved :: MIT License',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n    ],\n\n    packages=find_packages(exclude=('tests*', 'testing*')),\n    package_data={\n        'pre_commit': [\n            'resources/hook-tmpl',\n            'resources/pre-push-tmpl',\n            'resources/rbenv.tar.gz',\n            'resources/ruby-build.tar.gz',\n            'resources/ruby-download.tar.gz',\n            'resources/empty_template/*',\n            'resources/empty_template/.npmignore',\n        ],\n    },\n    install_requires=[\n        'aspy.yaml',\n        'cached-property',\n        'identify>=1.0.0',\n        'nodeenv>=0.11.1',\n        'pyyaml',\n        'six',\n        'virtualenv',\n    ],\n    entry_points={\n        'console_scripts': [\n            'pre-commit = pre_commit.main:main',\n            'pre-commit-validate-config = pre_commit.clientlib:validate_config_main',  # noqa\n            'pre-commit-validate-manifest = pre_commit.clientlib:validate_manifest_main',  # noqa\n        ],\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "from setuptools import find_packages\nfrom setuptools import setup\n\n\nsetup(\n    name='pre_commit',\n    description=(\n        'A framework for managing and maintaining multi-language pre-commit '\n        'hooks.'\n    ),\n    url='https://github.com/pre-commit/pre-commit',\n    version='1.1.1',\n\n    author='Anthony Sottile',\n    author_email='asottile@umich.edu',\n\n    platforms='linux',\n    classifiers=[\n        'License :: OSI Approved :: MIT License',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n    ],\n\n    packages=find_packages(exclude=('tests*', 'testing*')),\n    package_data={\n        'pre_commit': [\n            'resources/*',\n            'resources/empty_template/*',\n            'resources/empty_template/.npmignore',\n        ],\n    },\n    install_requires=[\n        'aspy.yaml',\n        'cached-property',\n        'identify>=1.0.0',\n        'nodeenv>=0.11.1',\n        'pyyaml',\n        'six',\n        'virtualenv',\n    ],\n    entry_points={\n        'console_scripts': [\n            'pre-commit = pre_commit.main:main',\n            'pre-commit-validate-config = pre_commit.clientlib:validate_config_main',  # noqa\n            'pre-commit-validate-manifest = pre_commit.clientlib:validate_manifest_main',  # noqa\n        ],\n    },\n)\n", "path": "setup.py"}]}