Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You couldn't run tests only on your staged changes pre-commit without the staging area. Right now my pre-commit hook stashes any non-staged changes, from inside the same files that has staged content, and then runs tests. This ensures I can create commits with just the stuff that works of my changes without first removing the ongoing work.

The staging area surely adds complexity, but if you do not like it then simply don't use git.



> This ensures I can create commits with just the stuff that works of my changes without first removing the ongoing work.

If I have ongoing work I want to remove, I just stash it, as you said. I don't need a staging area to stash things, and it's pretty rare that I'll have unrelated work anyway.

> The staging area surely adds complexity, but if you do not like it then simply don't use git.

Ah, the old "your arm hurts? Just cut it off!" solution. Yes, I will just not use git, I will just email my team diffs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: