I like to use git add --patch (and more recently, git add -i) to untangle my commits as well as verify that what I'm committing is good to go.
Once in a while I'll come across a hunk that might be an error logging statement, an extra newline (usually from erasing the aforementioned logging statement) - something that I'd actually rather remove entirely.
I don't want to stage and I'd also like to simply delete the hunk in question while it's right there in front me of (rather than jumping back to my editor and trying again). I want to apply the change against my working file as well.
Is there a way to do this?
What I've considered is using the edit hunk functionality.
This, in conjunction with the suggestion hash
made below gets me a slightly nicer workflow than I have now.
I agree that it's a violation of the git add
's separation of concerns. OTOH it would just be so convenient ;P I sound like my boss ;)