You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by AlaiyaNetwork September 18, 2023
Hi all, I encountered a few errors when using pre-commit hook with a large number of files in a commit.
1 error: fatal: Unable to create 'C:/WorkDirectory/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.
2 error: The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process.
The first error also occurs when using prettier, not only with custom scripts. But it doesn't cause the script to abort [Husky] ⚡ Preparing task 'Run prettier' [Husky] ⚠️ The Maximum argument length '8191' reached, splitting matched files into 16 chunks [Husky] ⌛ Executing task 'Run prettier' ... fatal: Unable to create 'C:/WorkDirectory/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue. [Husky] ✔ Successfully executed in 2 304ms
This is my custom script: [Husky] ⚡ Preparing task 'Run add header to main script' [Husky] ⚠️ The Maximum argument length '8191' reached, splitting matched files into 9 chunks [Husky] ⌛ Executing task 'Run add header to main script' ... The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process. The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process. The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process. The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process. fatal: Unable to create 'C:/WorkDirectory/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue. ❌ Task 'Run add header to main script' failed in 487ms husky - pre-commit hook exited with code 1 (error)
Discussed in #92
Originally posted by AlaiyaNetwork September 18, 2023
Hi all, I encountered a few errors when using pre-commit hook with a large number of files in a commit.
1 error:
fatal: Unable to create 'C:/WorkDirectory/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.
2 error:
The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process.
The first error also occurs when using prettier, not only with custom scripts. But it doesn't cause the script to abort
[Husky] ⚡ Preparing task 'Run prettier'
[Husky] ⚠️ The Maximum argument length '8191' reached, splitting matched files into 16 chunks
[Husky] ⌛ Executing task 'Run prettier' ...
fatal: Unable to create 'C:/WorkDirectory/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.
[Husky] ✔ Successfully executed in 2 304ms
This is my custom script:
[Husky] ⚡ Preparing task 'Run add header to main script'
[Husky] ⚠️ The Maximum argument length '8191' reached, splitting matched files into 9 chunks
[Husky] ⌛ Executing task 'Run add header to main script' ...
The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process.
The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process.
The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process.
The process cannot access the file 'C:\WorkDirectory\.husky\csx\add-header-to-main.csx' because it is being used by another process.
fatal: Unable to create 'C:/WorkDirectory/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.
❌ Task 'Run add header to main script' failed in 487ms
husky - pre-commit hook exited with code 1 (error)
Prettier task:
{ "name": "Run prettier", "command": "npx", "cwd": "Paylater.BackOffice.ReactApp", "args": [ "prettier", "--plugin", "prettier-plugin-organize-imports", "--ignore-unknown", "--write", "${staged}" ], "pathMode": "absolute" }
Maybe someone has encountered a similar problem and can give me a solution.
The text was updated successfully, but these errors were encountered: