News for hackers. Stuff that matters.
Re:Ask HN: Do you write tests before the implementation? by roblabla on Friday November 15, 2019 @07:32AM (#21544291)
Keeping it separate allows ensuring the test works easily: just revert the fix keeping only the patch for the test and make sure the test fails.

My workflow tend to be to keep them separate, and write a big description in the merge commit rather than the individual commits (those have a small description of the local change).

There's tradeoffs to both approach though, and as you mention, it's easier to keep track of the provenance of a fix in the git blame when it's unified in a single commit message.

Re:Ask HN: Do you write tests before the implementation? by lejar on Friday November 15, 2019 @07:57AM (#21544384)
I totally understand why you would do that and it makes sense, but I personally like to keep them in one commit so that I won't get any problems with an automated git bisect later.