Skip to content

Commit

Permalink
docs: add workaround for verbose Windows output to README FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Dec 2, 2023
1 parent 17bc480 commit 786f9dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changeset/giant-starfishes-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ module.exports = {

## Frequently Asked Questions

### The output of commit hook looks weird (no colors, duplicate lines, …)
### The output of commit hook looks weird (no colors, duplicate lines, verbose output on Windows, …)

<details>
<summary>Click to expand</summary>
Expand All @@ -660,6 +660,21 @@ https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes/2.37.0.t
> hook, which was noticed post release. This is getting corrected.
> (merge [a082345372](https://github.com/git/git/commit/a082345372) ab/hooks-regression-fix later to maint).
If updating Git doesn't help, you can try to manually redirect the output in your Git hook; for example:

```shell
# .husky/pre-commit

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec >/dev/tty 2>&1; fi

npx lint-staged
```

Source: https://github.com/typicode/husky/issues/968#issuecomment-1176848345

</details>

### Can I use `lint-staged` via node?
Expand Down

0 comments on commit 786f9dd

Please sign in to comment.