@@ -16,6 +16,8 @@ This is BibTags, a BibTeX library that contains many curated literature referenc
16
16
6 . Commit and push your changes
17
17
7 . Make a pull request to the original repo, which will be reviewed by an ISF member
18
18
19
+ * Life hack: Enable a pre-commit hook to enforce steps 4 and 5 (see below).*
20
+
19
21
## Sorting Order
20
22
Entries and their fields are sorted by the ` sort ` script.
21
23
- Entries are sorted by
@@ -145,6 +147,37 @@ The script can be configured using the following files
145
147
```
146
148
- `scripts/test/config_string.yaml`: Declares which fields should contain bibtex strings instead of literals.
147
149
150
+ ### Good practice: Check locally
151
+
152
+ To detect typical problems, running `./run sort` and `./run test` are crucial.
153
+ By default, you have to manually remember to do this, which is easy to forget.
154
+ You can optionally enable a pre-commit hook that always performs certain checks locally before allowing a commit.
155
+ There are several options:
156
+
157
+ - Check for sorting + test literature (this effectively executes the CI pipeline locally):
158
+ ```
159
+ echo '#!/usr/bin/env sh
160
+ set -e
161
+ ./run sorted
162
+ ./run test' > .git/hooks/pre-commit
163
+ chmod +x .git/hooks/pre-commit
164
+ ```
165
+ - Check for sorting only (this runs much faster than the previous option, but won't catch all mistakes):
166
+ ```
167
+ echo '#!/usr/bin/env sh
168
+ set -e
169
+ ./run sorted' > .git/hooks/pre-commit
170
+ chmod +x .git/hooks/pre-commit
171
+ ```
172
+ - To completely disable local checking again (the default state):
173
+ ```
174
+ rm -f .git/hooks/pre-commit
175
+ ```
176
+ - To skip checking only on a single commit, run:
177
+ ```
178
+ git commit --no-verify
179
+ ```
180
+
148
181
## Troubleshooting
149
182
150
183
- If you encounter the error message `short-natbib bibtex (Run 1/2)...fail` without any further error messages, try to clear the biber cache:
0 commit comments