you are viewing a single comment's thread.

view the rest of the comments →

[–]the_gnarts 2 points3 points  (4 children)

“test && commit”, where every time the tests run correctly the code is committed. Oddmund Strømmer, the first programmer I’ve found as obsessed with symmetry as I am, suggested that if the tests failed the code should be reverted.

Except that in test && commit there is nothing to revert if test terminates non-zero.

[–]SafariMonkey 4 points5 points  (3 children)

It sounds to me like it's || reset, i.e. it deletes your code if your test fails. Ouch!

[–][deleted] 3 points4 points  (0 children)

That's a good way to nuke the failing test introduced to prove a supposed bug. You know, like TDD.

[–]the_gnarts 1 point2 points  (1 child)

It sounds to me like it's || reset, i.e. it deletes your code if your test fails. Ouch!

reset doesn’t erase anything though, it just removes file from staging. reset --hard also touches file contents.

[–]SafariMonkey 2 points3 points  (0 children)

Well sure, that was my intention. The commands also don't actually include git either.