PSA: Did you know that itโ€™s **unsafe** to put code diffs into your commit messages?

Like https://github.com/i3/i3/pull/6564 for example

Such diffs will be applied by patch(1) (also git-am(1)) as part of the code change!

This is how a sleep(1) made it into i3 4.25-2 in Debian unstable.

@zekjur The commit-message should explain the "why", not the "how".

So when one needs a full diff (that can be retrieved by git itself) to explain the "why" ... I'd consider that an ... interesting edge-case...

@heiglandreas Have you actually read the commit message in question? Itโ€™s perfectly reasonable.

@zekjur I have read the commit message.

Whether that is reasonable is ... debatable.

Adding an actual commit with the change and explaining why it was done that way and then adding a second commit removing it with the respective why would have been a better option separating code and explanation.

Alternatively explaining that a test with `sleep(1)` after line xyz was done.

But perhaps that is the `edge-case` I was talking about? ๐Ÿคท

@heiglandreas @zekjur either way, tools should minimize the possibility of a "you're holding it wrong" scenario; inband signalling is roughly never a good idea.

Sadly we're probably stuck with what we have here for a long time coming.

@dngrs rm allows one to delete the whole filesystem even though one only wanted to remove the french locale...

Using `git patch-format` to get a patch-file and then applying that via `patch` or `git am` is an established workflow in git.

That it seems to have taken 20 years and I don't know how many commit-transfers in hundrets of thousands of git repos to go "wrong" tells me that someone was "holding it wrong"

/cc @zekjur