internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pre-commit/pre-commit

Issue:
rust hook requires `--path` attribute
Cargo has changed how packages get installed and requires an extra `--path <destination>` attribute.

Symptom:
```
[INFO] Initializing environment for https://github.com/nix-community/nixpkgs-fmt.
[INFO] Installing environment for https://github.com/nix-community/nixpkgs-fmt.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/nix/store/fcc3x8zwq1c0667xjs7bkn6ay8j4fdpz-rust-1.38.0-nightly-2019-08-07-ad7c55e1f/bin/cargo', 'install', '--bins', '--root', '/home/zimbatm/.cache/pre-commit/repoeft6xm6t/rustenv-default')
Return code: 101
Expected return code: 0
Output: (none)
Errors: 
    error: Using `cargo install` to install the binaries for the package in current working directory is no longer supported, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.
```

I guess the fix should be done where here: https://github.com/pre-commit/pre-commit/blob/9c6a1d80d6b94c86a1785a40a51389e83accac3e/pre_commit/languages/rust.py#L87

Do we want to make pre-commit compatible with multiple versions of cargo or just the latest one?

/cc @asottile @chriskuehl 


Discussion:
heh that's annoying, yeah let's update to the latest install construct
I think the change would look like?
```diff
diff --git a/pre_commit/languages/rust.py b/pre_commit/languages/rust.py
index e09d007..c036739 100644
--- a/pre_commit/languages/rust.py
+++ b/pre_commit/languages/rust.py
@@ -84,7 +84,11 @@ def install_environment(prefix, version, additional_dependencies):
 
         for package in packages_to_install:
             cmd_output(
-                'cargo', 'install', '--bins', '--root', directory, *package,
+                'cargo', 'install',
+                '--bins',
+                '--root', directory,
+                '--path', directory,
+                *package,
                 cwd=prefix.prefix_dir
             )
```
This install the bin in the `<directory>/bin` folder
Seems right to me, there's pretty good tests for this so hopefully the test suite should agree :thumbsup:

Resolving patch:
diff --git a/pre_commit/languages/rust.py b/pre_commit/languages/rust.py
--- a/pre_commit/languages/rust.py
+++ b/pre_commit/languages/rust.py
@@ -73,7 +73,7 @@ def install_environment(prefix, version, additional_dependencies):
         _add_dependencies(prefix.path('Cargo.toml'), lib_deps)
 
     with clean_path_on_failure(directory):
-        packages_to_install = {()}
+        packages_to_install = {('--path', '.')}
         for cli_dep in cli_deps:
             cli_dep = cli_dep[len('cli:'):]
             package, _, version = cli_dep.partition(':')


Test patch:
Repository: pre-commit/pre-commit

Issue:
Running `pre-commit` 1.20.0 on Guix gives server certificate verification failed. CAfile: none CRLfile: none
Running `pre-commit` 1.20.0 on Guix gives

```
An unexpected error has occurred: CalledProcessError: Command: ('/home/igankevich/.guix-profile/bin/git', 'fetch', 'origin', '--tags')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
    fatal: unable to access 'https://github.com/pre-commit/pre-commit-hooks/': server certificate verification failed. CAfile: none CRLfile: none

Traceback (most recent call last):
  File "/gnu/store/35ppc0zpffbzc6zsw9xnks1hxmr7wh19-python-pre-commit-1.20.0/lib/python3.7/site-packages/pre_commit/store.py", line 168, in clone_strategy
    self._shallow_clone(ref, _git_cmd)
  File "/gnu/store/35ppc0zpffbzc6zsw9xnks1hxmr7wh19-python-pre-commit-1.20.0/lib/python3.7/site-packages/pre_commit/store.py", line 150, in _shallow_clone
    git_cmd('-c', git_config, 'fetch', 'origin', ref, '--depth=1')
  File "/gnu/store/35ppc0zpffbzc6zsw9xnks1hxmr7wh19-python-pre-commit-1.20.0/lib/python3.7/site-packages/pre_commit/store.py", line 165, in _git_cmd
    cmd_output_b('git', *args, cwd=directory, env=env)
  File "/gnu/store/35ppc0zpffbzc6zsw9xnks1hxmr7wh19-python-pre-commit-1.20.0/lib/python3.7/site-packages/pre_commit/util.py", line 147, in cmd_output_b
    returncode, cmd, retcode, output=(stdout_b, stderr_b),
pre_commit.util.CalledProcessError: Command: ('/home/igankevich/.guix-profile/bin/git', '-c', 'protocol.version=2', 'fetch', 'origin', 'v2.4.0', '--depth=1')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
    fatal: unable to access 'https://github.com/pre-commit/pre-commit-hooks/': server certificate verification failed. CAfile: none CRLfile: none
```

It looks like pre-commit sanitises GIT_SSL_CAINFO environment variable. Guix uses this variable to specify the path to the certificates. I fixed this bug by _whitelisting_ GIT_SSL_CAINFO in `no_git_env` in `pre_commit/git.py`.


Discussion:
would you like to provide a patch?  should be an easy fix as you've already found 👍 

Resolving patch:
diff --git a/pre_commit/git.py b/pre_commit/git.py
--- a/pre_commit/git.py
+++ b/pre_commit/git.py
@@ -32,7 +32,7 @@ def no_git_env(_env=None):
     return {
         k: v for k, v in _env.items()
         if not k.startswith('GIT_') or
-        k in {'GIT_EXEC_PATH', 'GIT_SSH', 'GIT_SSH_COMMAND'}
+        k in {'GIT_EXEC_PATH', 'GIT_SSH', 'GIT_SSH_COMMAND', 'GIT_SSL_CAINFO'}
     }
 
 


Test patch:
Repository: pre-commit/pre-commit

Issue:
Slightly broken links in output
`pre-commit autoupdate` outputs repository links:

```
Updating https://github.com/psf/black...already up to date.
Updating https://github.com/prettier/prettier...already up to date.
```

In iTerm2 on a Mac using Fish Shell—and probably lots of other setups as well—you can click the repository links (by holding down the _Command_ key):

<img width="668" alt="Screenshot 2020-01-01 at 15 21 32" src="https://user-images.githubusercontent.com/8469540/71642362-6fcd2800-2caa-11ea-9e00-d463dcdf9682.png">

But the link is slightly broken because there is no space after it—we're getting https://github.com/asottile/seed-isort-config...already instead of https://github.com/asottile/seed-isort-config.

This is a tiny issue, but it would be nice if we could fix it. I'll try to make a pull request to show what I mean.


Discussion:

Resolving patch:
diff --git a/pre_commit/commands/autoupdate.py b/pre_commit/commands/autoupdate.py
--- a/pre_commit/commands/autoupdate.py
+++ b/pre_commit/commands/autoupdate.py
@@ -136,7 +136,7 @@ def autoupdate(config_file, store, tags_only, freeze, repos=()):
             rev_infos.append(None)
             continue
 
-        output.write('Updating {}...'.format(info.repo))
+        output.write('Updating {} ... '.format(info.repo))
         new_info = info.update(tags_only=tags_only, freeze=freeze)
         try:
             _check_hooks_still_exist_at_rev(repo_config, new_info, store)


Test patch:
Repository: pre-commit/pre-commit

Issue:
core.hooksPath being set makes it not possible to install
I have a laptop which has some mandaotry global settings for git, and I have not been able to enable pre-commit.  I also tried doing
```
git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template
```
But still get the message
```
[ERROR] Cowardly refusing to install hooks with `core.hooksPath` set.
hint: `git config --unset-all core.hooksPath`
```

Is there any work arounds for this?


Discussion:
I believe #1198 #718 #663 pre-commit/pre-commit-hooks#250 have more information on this

the problem is twofold: writing outside of the controlled directories has all sorts of implications that I don't really want to be involved in, the setting can lead to hooks not being executed when they should be

it is a little weird that `init-templatedir` complains about that though -- though this is most likely due to the code sharing between `install` and `init-templatedir`

let me see if that can be changed to better accommodate this :thinking: 

Resolving patch:
diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py
--- a/pre_commit/commands/install_uninstall.py
+++ b/pre_commit/commands/install_uninstall.py
@@ -123,7 +123,7 @@ def install(
         skip_on_missing_config: bool = False,
         git_dir: Optional[str] = None,
 ) -> int:
-    if git.has_core_hookpaths_set():
+    if git_dir is None and git.has_core_hookpaths_set():
         logger.error(
             'Cowardly refusing to install hooks with `core.hooksPath` set.\n'
             'hint: `git config --unset-all core.hooksPath`',


Test patch:
diff --git a/tests/commands/init_templatedir_test.py b/tests/commands/init_templatedir_test.py
--- a/tests/commands/init_templatedir_test.py
+++ b/tests/commands/init_templatedir_test.py
@@ -79,3 +79,14 @@ def test_init_templatedir_expanduser(tmpdir, tempdir_factory, store, cap_out):
     lines = cap_out.get().splitlines()
     assert len(lines) == 1
     assert lines[0].startswith('pre-commit installed at')
+
+
+def test_init_templatedir_hookspath_set(tmpdir, tempdir_factory, store):
+    target = tmpdir.join('tmpl')
+    tmp_git_dir = git_dir(tempdir_factory)
+    with cwd(tmp_git_dir):
+        cmd_output('git', 'config', '--local', 'core.hooksPath', 'hooks')
+        init_templatedir(
+            C.CONFIG_FILE, store, target, hook_types=['pre-commit'],
+        )
+    assert target.join('hooks/pre-commit').exists()
Repository: pre-commit/pre-commit

Issue:
cache + virtualenv>=20 / python_venv + moving executables -> File not found: ... python
failure mode looks something like this:

```
Check for added large files..............................................Failed
- hook id: check-added-large-files
- exit code: 1

Executable `/Users/runner/.cache/pre-commit/repo14qw_y0i/py_env-python3.8/bin/python` not found
```

currently this is a common failure for github actions caches, there's ~2 ways to work around this:

1. [add `$(which python)`](https://github.com/pre-commit/action/commit/ee269b64a608de770696d23079f46238c2f7ab5a) to the pre-commit cache key
2. [manually bump](https://github.com/pypa/pip/pull/7750/files) the pre-commit cache key

but pre-commit should more gracefully detect this in the [`healthy()`](https://github.com/pre-commit/pre-commit/blob/0a8ba31b9b6656d90f94fc368b47acb502cea44d/pre_commit/languages/python.py#L160-L168) function (which is designed to catch these sorts of system breakages)


Discussion:
@asottile for now, does it make sense for pip to just manually bump the pre-commit cache key again?
I would do (1) above
@duckinator we'd likely want to do it in a separate PR.

Resolving patch:
diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py
--- a/pre_commit/languages/python.py
+++ b/pre_commit/languages/python.py
@@ -158,10 +158,12 @@ def in_env(
             yield
 
     def healthy(prefix: Prefix, language_version: str) -> bool:
+        envdir = helpers.environment_dir(_dir, language_version)
+        exe_name = 'python.exe' if sys.platform == 'win32' else 'python'
+        py_exe = prefix.path(bin_dir(envdir), exe_name)
         with in_env(prefix, language_version):
             retcode, _, _ = cmd_output_b(
-                'python', '-c',
-                'import ctypes, datetime, io, os, ssl, weakref',
+                py_exe, '-c', 'import ctypes, datetime, io, os, ssl, weakref',
                 cwd='/',
                 retcode=None,
             )


Test patch:
diff --git a/tests/languages/python_test.py b/tests/languages/python_test.py
--- a/tests/languages/python_test.py
+++ b/tests/languages/python_test.py
@@ -59,3 +59,17 @@ def test_healthy_types_py_in_cwd(tmpdir):
         # even if a `types.py` file exists, should still be healthy
         tmpdir.join('types.py').ensure()
         assert python.healthy(prefix, C.DEFAULT) is True
+
+
+def test_healthy_python_goes_missing(tmpdir):
+    with tmpdir.as_cwd():
+        prefix = tmpdir.join('prefix').ensure_dir()
+        prefix.join('setup.py').write('import setuptools; setuptools.setup()')
+        prefix = Prefix(str(prefix))
+        python.install_environment(prefix, C.DEFAULT, ())
+
+        exe_name = 'python' if sys.platform != 'win32' else 'python.exe'
+        py_exe = prefix.path(python.bin_dir('py_env-default'), exe_name)
+        os.remove(py_exe)
+
+        assert python.healthy(prefix, C.DEFAULT) is False
Repository: pre-commit/pre-commit

Issue:
random.shuffle's random= argument got deprecated
Related issue: [bpo-40465](https://bugs.python.org/issue40465).
```
black..................................................................../home/isidentical/.venv/lib/python3.10/site-packages/pre_commit/languages/helpers.py:95: DeprecationWarning: The *random* parameter to shuffle() has been deprecated
since Python 3.9 and will be removed in a subsequent version.
  random.shuffle(seq, random=fixed_random.random)
Passed
```




Discussion:
well that's annoying.
Why not to use just
```python
fixed_random.shuffle(seq)
```
?

is that documented? I don't see it on https://docs.python.org/3/library/random.html
https://docs.python.org/3.9/library/random.html#random.shuffle
yeah that's what the current code is using?
> yeah that's what the current code is using?

I think what @serhiy-storchaka is suggesting that, since you set a custom seed you can use directly `fixed_random`'s shuffle method.
```py
def _shuffled(seq: Sequence[str]) -> List[str]:
    """Deterministically shuffle"""
    fixed_random = random.Random()
    fixed_random.seed(FIXED_RANDOM_SEED, version=1)

    seq = list(seq)
    fixed_random.shuffle(seq)
    return seq
```
I get that, but where in the documentation does it say that `Random` has a `shuffle` method -- the link above is to the module's function
> The functions supplied by this module are actually bound methods of a hidden instance of the random.Random class. You can instantiate your own instances of Random to get generators that don’t share state.
🤦 and here I was expecting it to be documented under https://docs.python.org/3/library/random.html#random.Random

Resolving patch:
diff --git a/pre_commit/languages/helpers.py b/pre_commit/languages/helpers.py
--- a/pre_commit/languages/helpers.py
+++ b/pre_commit/languages/helpers.py
@@ -18,7 +18,7 @@
 if TYPE_CHECKING:
     from typing import NoReturn
 
-FIXED_RANDOM_SEED = 1542676186
+FIXED_RANDOM_SEED = 1542676187
 
 
 def run_setup_cmd(prefix: Prefix, cmd: Tuple[str, ...]) -> None:
@@ -92,7 +92,7 @@ def _shuffled(seq: Sequence[str]) -> List[str]:
     fixed_random.seed(FIXED_RANDOM_SEED, version=1)
 
     seq = list(seq)
-    random.shuffle(seq, random=fixed_random.random)
+    fixed_random.shuffle(seq)
     return seq
 
 


Test patch:
diff --git a/tests/languages/helpers_test.py b/tests/languages/helpers_test.py
--- a/tests/languages/helpers_test.py
+++ b/tests/languages/helpers_test.py
@@ -78,5 +78,5 @@ def test_target_concurrency_cpu_count_not_implemented():
 
 def test_shuffled_is_deterministic():
     seq = [str(i) for i in range(10)]
-    expected = ['3', '7', '8', '2', '4', '6', '5', '1', '0', '9']
+    expected = ['4', '0', '5', '1', '8', '6', '2', '3', '7', '9']
     assert helpers._shuffled(seq) == expected
Repository: pre-commit/pre-commit

Issue:
Can't use ruby 2.7.1 on MacOS
Hi, 

Bumping my ruby hooks to version 2.7.1 worked fine for me on Ubuntu but doesn't work for my colleagues using MacOS, is there something to do about bumping rbenv archives ? 

Thanks


Discussion:
"doesn't work" isn't a bug report, show me commands, outputs, configuration, etc.
Ping @gterral
I was actually asking if there is a "process" for the introduction of new ruby versions since there are bundled `ruby-build`, `ruby-download` and `rbenv` tar archives versioned in this repo : https://github.com/pre-commit/pre-commit/tree/master/pre_commit/resources
for prebuilts it's usually just automatic as rvm.io adds them, for building-from-source the rbenv archive is updated using the scripts

note also that there's a third option now, `language_version: system` (the default if both `ruby` and `gem` exist) which'll reuse the system `gem` / `ruby` binaries but install in an isolated environment

Resolving patch:
diff --git a/pre_commit/make_archives.py b/pre_commit/make_archives.py
--- a/pre_commit/make_archives.py
+++ b/pre_commit/make_archives.py
@@ -15,8 +15,8 @@
 
 
 REPOS = (
-    ('rbenv', 'git://github.com/rbenv/rbenv', 'a3fa9b7'),
-    ('ruby-build', 'git://github.com/rbenv/ruby-build', '1a902f3'),
+    ('rbenv', 'git://github.com/rbenv/rbenv', '0843745'),
+    ('ruby-build', 'git://github.com/rbenv/ruby-build', '258455e'),
     (
         'ruby-download',
         'git://github.com/garnieretienne/rvm-download',


Test patch:
Repository: pre-commit/pre-commit

Issue:
Rbenv default ruby issue on install
I am trying to install MDL v0.11.0

i get the following error during install 
```
pre-commit
[INFO] Installing environment for git://github.com/markdownlint/markdownlint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/usr/local/bin/bash', '/Users/abuxton/.rbenv/shims/gem', 'build', 'mdl.gemspec')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    rbenv: version `default' is not installed (set by RBENV_VERSION environment variable)
```

seems to be the same issue as https://github.com/pre-commit/pre-commit/issues/369 on a previous version of pre-commit
pre-commit.log https://gist.github.com/abuxton/d29e6265f3230f838a746d7a5defd5e3 

i have tried, ensuring local rbenv, I have tried pre-commit clean/uninstall and reinstall to no success, mdl will `brew install mdl` successfully and works fine. 



Discussion:
ah yeah, this has regressed because it's difficult to test!  pre-commit ~correctly identified that you're using shims globally so it shouldn't necessarily trust that ruby, but then used it anyway 😆 -- this `if` here needs to also apply to `'default'`:  https://github.com/pre-commit/pre-commit/blob/59acc7e48a58de3771d7552c64104add7e3dd1bf/pre_commit/languages/ruby.py#L43
actually hmm this seems really strange -- pre-commit should still be creating an rbenv shim in that case so my suggested patch above isn't quite correct

Resolving patch:
diff --git a/pre_commit/languages/ruby.py b/pre_commit/languages/ruby.py
--- a/pre_commit/languages/ruby.py
+++ b/pre_commit/languages/ruby.py
@@ -52,7 +52,6 @@ def get_env_patch(
     else:  # pragma: win32 no cover
         patches += (
             ('RBENV_ROOT', venv),
-            ('RBENV_VERSION', language_version),
             (
                 'PATH', (
                     os.path.join(venv, 'gems', 'bin'), os.pathsep,
@@ -61,6 +60,9 @@ def get_env_patch(
                 ),
             ),
         )
+    if language_version not in {'system', 'default'}:  # pragma: win32 no cover
+        patches += (('RBENV_VERSION', language_version),)
+
     return patches
 
 


Test patch:
Repository: pre-commit/pre-commit

Issue:
Add warning for `files` / `exclude` containing `/*`
it's a common mistake to believe that those fields are globs, they're not -- they're regular expressions. (and matching `/*` is nonsense, it matches `''`, `'/'` as well as `'//////////////////////////////////////////////////////'`


Discussion:

Resolving patch:
diff --git a/pre_commit/clientlib.py b/pre_commit/clientlib.py
--- a/pre_commit/clientlib.py
+++ b/pre_commit/clientlib.py
@@ -112,6 +112,18 @@ def validate_manifest_main(argv: Optional[Sequence[str]] = None) -> int:
 META = 'meta'
 
 
+class OptionalSensibleRegex(cfgv.OptionalNoDefault):
+    def check(self, dct: Dict[str, Any]) -> None:
+        super().check(dct)
+
+        if '/*' in dct.get(self.key, ''):
+            logger.warning(
+                f'The {self.key!r} field in hook {dct.get("id")!r} is a '
+                f"regex, not a glob -- matching '/*' probably isn't what you "
+                f'want here',
+            )
+
+
 class MigrateShaToRev:
     key = 'rev'
 
@@ -227,6 +239,8 @@ def warn_unknown_keys_repo(
         for item in MANIFEST_HOOK_DICT.items
         if item.key != 'id'
     ),
+    OptionalSensibleRegex('files', cfgv.check_string),
+    OptionalSensibleRegex('exclude', cfgv.check_string),
 )
 CONFIG_REPO_DICT = cfgv.Map(
     'Repository', 'repo',


Test patch:
diff --git a/tests/clientlib_test.py b/tests/clientlib_test.py
--- a/tests/clientlib_test.py
+++ b/tests/clientlib_test.py
@@ -166,6 +166,23 @@ def test_validate_warn_on_unknown_keys_at_top_level(tmpdir, caplog):
     ]
 
 
+def test_validate_optional_sensible_regex(caplog):
+    config_obj = {
+        'id': 'flake8',
+        'files': 'dir/*.py',
+    }
+    cfgv.validate(config_obj, CONFIG_HOOK_DICT)
+
+    assert caplog.record_tuples == [
+        (
+            'pre_commit',
+            logging.WARNING,
+            "The 'files' field in hook 'flake8' is a regex, not a glob -- "
+            "matching '/*' probably isn't what you want here",
+        ),
+    ]
+
+
 @pytest.mark.parametrize('fn', (validate_config_main, validate_manifest_main))
 def test_mains_not_ok(tmpdir, fn):
     not_yaml = tmpdir.join('f.notyaml')
Repository: pre-commit/pre-commit

Issue:
running `pre-commit autoupdate` fails because tip of HEAD is missing hook
Hello 👋 
I'm setting up `pre-commit` on a project and came across an issue when adding hook `destroyed-symlinks`. The error message suggested running `pre-commit autoupdate`. I ran that and saw that it cannot update because the tip of HEAD is missing that hook. I'm not sure what that means so posting here.

```console
$ echo '    -   id: destroyed-symlinks' >> .pre-commit-config.yaml
$ git add -p !$
git add -p .pre-commit-config.yaml
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index bfde4717..949f3ffc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -21,3 +21,4 @@ repos:
     -   id: check-vcs-permalinks
     -   id: check-xml
     -   id: debug-statements
+    -   id: destroyed-symlinks
(1/1) Stage this hunk [y,n,q,a,d,e,?]? y

$ git commit -m 'new hook destroyed-symlinks'
[ERROR] `destroyed-symlinks` is not present in repository https://github.com/pre-commit/pre-commit-hooks.  Typo? Perhaps it is introduced in a newer version?  Often `pre-commit autoupdate` fixes this.
$ git status
On branch pre-commit
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   .pre-commit-config.yaml

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        tests/__init__.py

$ pre-commit autoupdate
Updating https://github.com/pre-commit/pre-commit-hooks ... [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
Cannot update because the tip of HEAD is missing these hooks:
destroyed-symlinks
$ git checkout .
Updated 0 paths from the index
$ pre-commit autoupdate
Updating https://github.com/pre-commit/pre-commit-hooks ... Cannot update because the tip of HEAD is missing these hooks:
destroyed-symlinks
$ pre-commit --version
pre-commit 2.9.0
```


Discussion:
ah the error message never got updated from when the default behaviour of autoupdate switched from what is now `--bleeding-edge` to picking tags.  `pre-commit autoupdate --bleeding-edge` can get you to that not-yet-released hook if you need it

[this](https://github.com/pre-commit/pre-commit/blob/099213f3657998df4028b493d53d87d59bbc126f/pre_commit/commands/autoupdate.py#L82) should mention instead of "tip of HEAD" "update target" or "latest tag" or something of the sort

Resolving patch:
diff --git a/pre_commit/commands/autoupdate.py b/pre_commit/commands/autoupdate.py
--- a/pre_commit/commands/autoupdate.py
+++ b/pre_commit/commands/autoupdate.py
@@ -79,8 +79,8 @@ def _check_hooks_still_exist_at_rev(
     hooks_missing = hooks - {hook['id'] for hook in manifest}
     if hooks_missing:
         raise RepositoryCannotBeUpdatedError(
-            f'Cannot update because the tip of HEAD is missing these hooks:\n'
-            f'{", ".join(sorted(hooks_missing))}',
+            f'Cannot update because the update target is missing these '
+            f'hooks:\n{", ".join(sorted(hooks_missing))}',
         )
 
 


Test patch: