@ftregan@mastodon.tetaneutral.net
Post #1187702
2026-03-19 14:55 UTC
Petit hook git pour mettre les derniers message de commit dans les commentaires du template (histoire de savoir ou en en etait et de respecter le style des messages precedents) :
$ cat .git/hooks/prepare-commit-msg
#!/bin/sh
#
if [ "$2" = "commit" ]; then
exit 0
fi
addition=$(git log --oneline | head -n 5 | sed "s/^\S*/\# -/")
sed -i -e 1s/.*/#/ $1
mv $1 $1.old
echo "\n# Previous commit messages:\n$addition" > $1
cat $1.old >> $1
rm $1.old
Replies (1)
-
@ftregan@mastodon.tetaneutral.net 2026-03-19 14:57
ca donne ca : # Previous commit messages: # - [CLEANUP] Improve data allocations # - [CLEANUP] Move missile handling to a macro # - [CLEANUP] Move cannon moving to a macro # - [CLEANUP] Improve if/then/else labeling # - [FIX] Correct label of if-block in SET_MONSTER_GFX # # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch main # Your branch is up to date with 'rad/main'. # …