Skip to content

Instantly share code, notes, and snippets.

View dryaz's full-sized avatar

Dmitrii Riazantsev dryaz

View GitHub Profile
@dryaz
dryaz / commit-msg
Last active December 3, 2019 08:32 — forked from shytikov/commit-msg
commit-msg hook script
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
#
NAME=$(git branch | grep '*' | sed 's/*.*\///')
DESCRIPTION=$(git config branch."$NAME".description)
echo "$NAME: $(cat $1)" > "$1"
if [ -n "$DESCRIPTION" ]
then