Toxic Elephant

Don't bury it in your back yard!

If you have Oops commits, you're doing it wrong

Posted by matijs 16/09/2010 at 17h22

If you still have commits with messages like ‘Oops, I forgot this file’, you’re doing something wrong. Just use git commit --amend.

But I don’t use git!

You really should use git. Oh, for so many reasons, just one of them being the existence of git commit --amend.

But we use Subversion at work.

You really should use git-svn. All the distributed, offline, history-rewriting goodness of git, and you can still commit to your central repository (after you used git commit --amend to fix your commit).

But I made other commits in between.

There are more complex tools in git. You probably want to use git rebase --interactive.

But I already pushed my changes upstream.

You’re still doing it wrong. You should have run your tests before pushing your changes.

But all my tests passed.

You’re not really testing properly then, are you?

Your argumentation is wrong.

You’re right. The tests are a red herring.

Any thoughts?

Let me think about it.

Well?

You should also have checked for any untracked and uncommitted files, using git status.

But some of the files I forgot to check in were ignored by git.

Well, you’re doing that wrong then.

Tags no comments no trackbacks

Comments

Comments are disabled