Commit Graph
3 Commits
Author SHA1 Message Date
Frederik “Freso” S. Olesen abd79707af Make the git-commit hook script POSIX compliant.
On a lot of systems using bashisms in /bin/sh scripts will be fine,
since /bin/sh is a symlink to /bin/bash, but some systems symlink it to
the more lightweight (and more strictly POSIX) /bin/dash or some other
shell. Safest thing is to not assume a bashism will work.

What has been changed:
1) `[[ … ]]` is a bashism. Replaced with `[ … ]`.
2) `-eq` is for numeric operations. When a variable is quoted, it
   becomes a string and uses `=` for comparison.
3) `&&` is a shell thing, but does not exist in `test`'s syntax.
   (`[ … ]` is shorthand for `test …`.) `-a` is the "and" when
   talking `test`.
2016-08-04 21:46:52 +02:00
Frederik “Freso” S. Olesen c6dec4518a Make the pre-commit Git hook executable.
This allows for symlinking it in .git/hooks/ directly[1] or executing
it from within an already existing `pre-commit` hook/script without
calling out to an interpreter in there[2], thus keeping up with any
upstream changes to it automatically.

Follow-up to e3b39b7233 / https://github.com/loot/loot/issues/622

[1] `ln -s ../../scripts/git/pre-commit .git/hooks/pre-commit`
[2] `./scripts/git/pre-commit` vs. `/bin/sh ./scripts/git/pre-commit`
2016-08-04 21:46:16 +02:00
Oliver Hamlet e3b39b7233 Add Git pre-commit hook for generating POT file
It will generate a POT file, then add it to the commit if more than one
line is changed (because there's no point committing it if the only
change is to the creation time), and discard the generated file
otherwise.

The generated POT file changes the order of a few of its entries, so
I've included that in this commit.
2016-08-04 19:00:36 +01:00