@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 847f883232
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 00:45 UTC

[Git] Automatically sign-off commits (#12595)

It's very annoying when I forgot to add `-s` in `git commit` to sign-off, because I then need to `git rebase HEAD~1 --signoff` and `git push -f` to fix the DCO. This PR adds a hook to sign off commits automatically when `-s` is missing to solve this problem. The only change from the user side is now users have to install 2 hooks, so instead of just ``` pre-commit install ``` Now we need to ``` pre-commit install --hook-type pre-commit --hook-type commit-msg ``` Note that even if users still only install the pre-commit hook, they won't get any error in `git commit`. Just the sign-off hook won't run. cc @hmellor @youkaichao --------- Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>

Cody Yu committed Jan 31, 2025 at 12:30 UTC 847f883232cedef583775d6f4e13baa2446ba1c7
3 files changed +16 -2
.pre-commit-config.yaml
+13
@@ -85,9 +85,22 @@ repos:
85 entry: tools/png-lint.sh
86 language: script
87 types: [png]
88 + - id: signoff-commit
89 + name: Sign-off Commit
90 + entry: bash
91 + args:
92 + - -c
93 + - |
94 + if ! grep -q "^Signed-off-by: $(git config user.name) <$(git config user.email)>" .git/COMMIT_EDITMSG; then
95 + printf "\nSigned-off-by: $(git config user.name) <$(git config user.email)>\n" >> .git/COMMIT_EDITMSG
96 + fi
97 + language: system
98 + verbose: true
99 + stages: [commit-msg]
100 - id: suggestion
101 name: Suggestion
102 entry: bash -c 'echo "To bypass pre-commit hooks, add --no-verify to git commit."'
103 language: system
104 verbose: true
105 pass_filenames: false
106 +
docs/source/contributing/overview.md
+1 -1
@@ -26,7 +26,7 @@ Check out the [building from source](#build-from-source) documentation for detai
26 pip install -r requirements-dev.txt
27
28 # Linting, formatting and static type checking
29 -pre-commit install
29 +pre-commit install --hook-type pre-commit --hook-type commit-msg
30
31 # You can manually run pre-commit with
32 pre-commit run --all-files
format.sh
+2 -1
@@ -1,5 +1,6 @@
1 #!/bin/bash
2
3 echo "vLLM linting system has been moved from format.sh to pre-commit hook."
4 -echo "Please run 'pip install -r requirements-lint.txt' and 'pre-commit install' to install the pre-commit hook."
4 +echo "Please run 'pip install -r requirements-lint.txt', followed by"
5 +echo "'pre-commit install --hook-type pre-commit --hook-type commit-msg' to install the pre-commit hook."
6 echo "Then linters will run automatically before each commit."