Commit Graph

13 Commits

Author SHA1 Message Date
b96d32996b *: Wrap lines at 80 columns where appropriate
Wrap lines at 80 columns where appropriate and I had the energy to think
about how/where to wrap.

There are still lines longer than that, which I plan to wrap in the
future. But that is enough for now.
2022-06-23 23:59:00 +02:00
f620e6d577 meta:hooks:commit-msg: Improve body recognition
Before, the commit-msg hook would not catch too long lines when
squashing commits, as the provided message starts immediately with a
commented line.

Instead of simply using all lines until the first comment, use all lines
until git's cut-line and remove all commented lines in between.

Do not hard-code git's commentary character but rather use
`core.commentChar`. `auto` is depending of the context interpreted as
'any character' or `#`.
2022-06-23 23:58:34 +02:00
7126a40c71 meta:hooks:commit-msg: Allow {fixup,squash} prefix
Allow the "fixup! " and "squash! " prefix' created by the
`--fixup`/`--squash` flags to `git-commit`
2022-06-23 23:58:33 +02:00
b1d396babd *: Use /usr/bin/env in shebangs for bash & zsh
To increase the portability (OSX for example has zsh under `/bin/zsh`).
2021-07-14 13:48:21 +02:00
9a7c5e6c47 meta:git-hooks:commit-msg: Fix typo
I have no idea how I have not noticed this yet, as apparently every time
I wrote a commit message that contains a body and not just a subject I
got an error message complaining that the first word does not exist as a
command. (With the exception of when it actually is, but then executing
arbitrary code)
2021-06-30 12:51:29 +02:00
03b6ba72ae meta:hooks:commit-msg: Break on first comment
Because `git diff --staged -u | head -1` returns nothing when rebasing
the hook checked the line length of the commit changes (verbose commit).
2020-12-23 19:45:56 +01:00
druckdev
6cac0dc53a git: Show patch of the changes in commit message
The changes are only shown in the editor and do not land in the final
commit message.

For that setting the git-commit-last-msg function and the commit-msg
hook had to be updated.
The function is now a standalone function instead of anonymous and
uses every line until the first comment in COMMIT_EDITMSG discarding the
new information too.
The hook breaks now when checking line lengths when the changes start
since for some weird reason they are passed together with the rest of
the message instead of being deleted like the comments.
2020-11-23 01:27:51 +01:00
druckdev
67c30e9842 meta:hooks:commit-msg: Allow dots and slashes
Allow dots and slashes in the program specification in the subject.
2020-10-26 15:04:20 +01:00
druckdev
0db8155002 meta:hooks: Refactor commit-msg (sh -> bash)
Refactor commit-msg to reduce redundancies by splitting up the pattern
into the different 'levels'.
For the array the change from /bin/sh to /bin/bash was necessary.
Because of that: Change all `test` occurrences to [[ ]] for performance.
2020-10-26 15:00:38 +01:00
druckdev
552b467102 meta:commit-msg-hook: Add more special characters 2020-10-10 13:26:42 +02:00
druckdev
9bb96e26e7 git:hook:commit-msg: Allow capitals and numbers
Allow capitals and numbers in the program name specification in the
subject line.
2020-10-06 00:59:13 +02:00
druckdev
d0da230266 git:hook:commit-msg: Allow some special characters
Allow some special character in the program name specification in the
subject line.
2020-10-03 01:30:04 +02:00
druckdev
10c8d7097a meta: Add commit-msg git hook 2020-09-25 02:27:57 +02:00