Repository navigation
Stopped working with pre-commit #1159
Copy link
Copy link
Closed
Labels
Description
I keep getting the following error when trying to use pre-commit codespell hook on my repository (I was able to use it a few weeks ago). I've tried reinstalling pre-commit, upgrading git, as well as cloning my repository again. Is anyone having the same issue?
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
An unexpected error has occurred: CalledProcessError: Command: ('C:\\Program Files\\Git\\mingw64\\bin\\git.exe', 'fetch', 'origin', '--tags')
Return code: 1
Expected return code: 0
Output: (none)
Errors:
From https://github.com/codespell-project/codespell
* [new branch] dict -> origin/dict
* [new branch] master -> origin/master
* [new branch] peternewman-aspell-dict-check -> origin/peternewman-aspell-dict-check
* [new branch] peternewman-bodgy -> origin/peternewman-bodgy
* [new branch] pr-skip -> origin/pr-skip
error: cannot lock ref 'refs/remotes/origin/pr/aux': Unable to create 'C:/Users/<user>/.cache/pre-commit/repo5tf14_g0/.git/refs/remotes/origin/pr/aux.lock': No such file or directory
! [new branch] pr/aux -> origin/pr/aux (unable to update local ref)
* [new branch] pr/fix-install -> origin/pr/fix-install
* [new branch] v1.0.x -> origin/v1.0.x
* [new branch] v1.1.x -> origin/v1.1.x
* [new branch] v1.2.x -> origin/v1.2.x
* [new tag] 1.10.0 -> 1.10.0
* [new tag] log -> log
* [new tag] v0.9 -> v0.9
* [new tag] v1.0 -> v1.0
* [new tag] v1.0-rc1 -> v1.0-rc1
* [new tag] v1.0-rc2 -> v1.0-rc2
* [new tag] v1.0-rc3 -> v1.0-rc3
* [new tag] v1.0.1 -> v1.0.1
* [new tag] v1.0.2 -> v1.0.2
* [new tag] v1.0.3 -> v1.0.3
* [new tag] v1.1 -> v1.1
* [new tag] v1.1-rc1 -> v1.1-rc1
* [new tag] v1.1-rc2 -> v1.1-rc2
* [new tag] v1.1.1 -> v1.1.1
* [new tag] v1.10.0 -> v1.10.0
* [new tag] v1.11.0 -> v1.11.0
* [new tag] v1.12.0 -> v1.12.0
* [new tag] v1.13.0 -> v1.13.0
* [new tag] v1.14.0 -> v1.14.0
* [new tag] v1.15.0 -> v1.15.0
* [new tag] v1.2 -> v1.2
* [new tag] v1.3 -> v1.3
* [new tag] v1.4 -> v1.4
* [new tag] v1.5 -> v1.5
* [new tag] v1.6 -> v1.6
* [new tag] v1.7 -> v1.7
* [new tag] v1.8 -> v1.8
* [new tag] v1.9.0 -> v1.9.0
* [new tag] v1.9.1 -> v1.9.1
* [new tag] v1.9.2 -> v1.9.2
Reactions are currently unavailable
Activity
peternewman commentedon Jun 18, 2019
Hi @x249wang ,
Where did the hook come from?
I can see @marco-c added stuff in #1117 referencing https://pre-commit.com/ but we don't seem to have made it into the hook list ( https://pre-commit.com/hooks.html via https://github.com/pre-commit/pre-commit.github.io/blob/real_master/all-repos.yaml ).
The issue looks to be because @lucasdemarchi had some branches with slashes in the name, which is confusing Windows as it sees them as folder paths *although they're all a few years old, so I don't know why it's suddenly got upset):
https://github.com/codespell-project/codespell/branches/all
It looks like one was merged successfully so we could just delete it, the one one got closed, so can probably go, but we ought to check with him.
If you can get pre-commit to only check-out master, then I think it would all just work.
peternewman commentedon Jun 18, 2019
See also discussion in pre-commit/pre-commit#1058 .
larsoner commentedon Jun 18, 2019
Thanks for the investigation @peternewman, I agree those look like cruft so I've deleted them. @lucasdemarchi if you need the branches I do have local copies I could push to your fork.
(As an aside, it's pretty common for repos to have
/in PR names since often there ismaint/X.XXormaintenance/X.XXso I assume they'll have to fix this upstream at some point.)peternewman commentedon Jun 18, 2019
Thanks @larsoner . Agreed, although as they mentioned in the other issue, it looks like a bug in Git on Windows not handling slashes if anything.
peternewman commentedon Jun 18, 2019
It's now on the website via pre-commit/pre-commit.com#237
asottile commentedon Jun 18, 2019
I mailed the git mailing list, they helpfully pointed out that it's not the directory but the name "aux":
x249wang commentedon Jun 19, 2019
That fixed the issue for me. Thank you!