Enhancing pre-commit bash script documentation.#3638
Merged
azz merged 7 commits intoprettier:masterfrom Feb 24, 2018
Merged
Conversation
lydell
reviewed
Jan 3, 2018
| exit 0 | ||
| ``` | ||
|
|
||
| In case you experience a problem causing your prettified files to appear modified according to git. You may also need a post-commit script in `.git/hooks/pre-commit` as described in [this issue](https://github.com/prettier/prettier/issues/2978#issuecomment-334408427). |
| exit 0 | ||
| ``` | ||
|
|
||
| In case you experience a problem causing your prettified files to appear modified according to git. You may also need a post-commit script in `.git/hooks/post-commit` as described in [this issue](https://github.com/prettier/prettier/issues/2978#issuecomment-334408427). Here is the code of the post-commit hook: |
Collaborator
There was a problem hiding this comment.
Slight grammar tweak, maybe something like:
If git is reporting that your prettified files are still modified after committing, you may need to add a post-commit script to update git's index as described in this issue.
Add something like the following to
.git/hooks/post-commit:#!/bin/sh git update-index -g exit 0
j-f1
reviewed
Jan 5, 2018
| If git is reporting that your prettified files are still modified after committing, you may need to add a post-commit script to update git's index as described in [this issue](https://github.com/prettier/prettier/issues/2978#issuecomment-334408427). | ||
|
|
||
| In case you experience a problem causing your prettified files to appear modified according to git. You may also need a post-commit script in `.git/hooks/post-commit` as described in [this issue](https://github.com/prettier/prettier/issues/2978#issuecomment-334408427). Here is the code of the post-commit hook: | ||
| Add something like the following to .git/hooks/post-commit: |
Member
There was a problem hiding this comment.
Could you mark up .git/hooks/post-commit as `code`?
Mark .git/hooks/post-commit as ```code```
j-f1
reviewed
Jan 9, 2018
| If git is reporting that your prettified files are still modified after committing, you may need to add a post-commit script to update git's index as described in [this issue](https://github.com/prettier/prettier/issues/2978#issuecomment-334408427). | ||
|
|
||
| Add something like the following to .git/hooks/post-commit: | ||
| Add something like the following to ```.git/hooks/post-commit```: |
Member
There was a problem hiding this comment.
I think you just need one ` on each side (`.git/hooks/post-commit`).
azz
requested changes
Jan 9, 2018
| ```bash | ||
| #!/bin/sh | ||
| git update-index -g | ||
| exit 0 |
Member
There was a problem hiding this comment.
exit 0 shouldn't be required, it's the default for a terminating script.
Contributor
Author
There was a problem hiding this comment.
Corrected. I tested it for several commits it works as expected.
lipis
approved these changes
Feb 22, 2018
azz
approved these changes
Feb 24, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in the issue, here is my proposition of the documentation enhancement.