Good Cop, Bad Cop

Mein Pullover für die Klausuraufsicht!

powered by Spreadshirt

Es gibt noch mehr Varianten:

powered by Spreadshirtpowered by Spreadshirt

powered by Spreadshirtpowered by Spreadshirt

git commit hook: Morse Code translation

I am very much in favour of version control systems to keep documents like papers, lecture notes, exercise sheets, … basically everything in.

This is the story of how I tried to convince/train a colleague to write sensible commit messages — which resulted in the probably least useful commit hook ever.

A few weeks into the semester, git log repeatedly showed me the following message:

    ...

My complaining about vacuous commit messages resulted in these:

    bla
    
    blabla

    mehr bla

Several complaints later:

                        .

       .                   .

    .   .                   .

    ..-. .. -. .- .-.. ...- . .-. ... .. --- -. --- ..-. - .... .. .-. -.. ... .

Now hang on… The last one was different! And it went on like that:

    ...- --- .-. ... -.-. .... .-.. .- --. ..-. ..- . .-. .- ..- ..-. --. .- -..

    -. --- -.-. .... . .. -. ...- --- .-. ... -.-. .... .-.. .- --.

Since reading Morse Code nowadays seems like an utterly useless skill, I decided to have a commit hook do this for me.

It is written in Python and adds the translation of the Morse Code (or anything that looks like Morse Code) to the end of the commit message.
You can download it here.

With the first version the commit messages looked as follows:

commit e2af21c6b64bb0d5db1447c92879db4c4c9524f6
Author: Silke Horn

    -- --- .-. ... .  -.-. --- -.. .  .... --- --- -.-
    morse code hook

commit 2d614cce719bebb17798cbf9fcf55157da513e21
Author: Silke Horn

    .. ..-.  - .... .  -- --- ..- -. - .- .. -.  .-- --- -. .----. -  --. .-. --- .--  ..- .--.  -- ..- .... .- -- -- .- -
    if the mountain won't grow up muhammad has to write a hook

I convinced my colleague to install the hook; now the messages were once again easy to read. Unfortunately their content quickly went back to the likes of “bla” and “bla bla”.
So we were back to square one..