Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 1 | README for git hooks script |
| 2 | =========================== |
| 3 | git has a way to run scripts, which are invoked by specific git commands. |
Tom Cosgrove | 0b86ac1 | 2022-07-29 13:44:01 +0100 | [diff] [blame] | 4 | The git hooks are located in `<Mbed TLS root>/.git/hooks`, and as such are not under version control |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 5 | for more information, see the [git documentation](https://git-scm.com/docs/githooks). |
| 6 | |
Tom Cosgrove | 0b86ac1 | 2022-07-29 13:44:01 +0100 | [diff] [blame] | 7 | The Mbed TLS git hooks are located in `<Mbed TLS root>/tests/git-scripts` directory, and one must create a soft link from `<Mbed TLS root>/.git/hooks` to `<Mbed TLS root>/tests/git-scripts`, in order to make the hook scripts successfully work. |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 8 | |
| 9 | Example: |
| 10 | |
Tom Cosgrove | 0b86ac1 | 2022-07-29 13:44:01 +0100 | [diff] [blame] | 11 | Execute the following command to create a link on Linux from the Mbed TLS `.git/hooks` directory: |
Ron Eldor | d922c78 | 2017-07-24 15:52:18 +0300 | [diff] [blame] | 12 | `ln -s ../../tests/git-scripts/pre-push.sh pre-push` |
Ron Eldor | bf007d2 | 2016-12-15 14:42:37 +0200 | [diff] [blame] | 13 | |
Tom Cosgrove | 0b86ac1 | 2022-07-29 13:44:01 +0100 | [diff] [blame] | 14 | **Note: Currently the Mbed TLS git hooks work only on a GNU platform. If using a non-GNU platform, don't enable these hooks!** |
Ron Eldor | d731eb8 | 2017-07-23 15:25:32 +0300 | [diff] [blame] | 15 | |
| 16 | These scripts can also be used independently. |