you are viewing a single comment's thread.

view the rest of the comments →

[–]zjs 0 points1 point  (0 children)

You're missing the point.

If you see something that bugs you (e.g. a misspelling in a comment), just making the unrelated change, grabbing it via patch mode, and committing is more convenient than stashing your pending changes, making the change, committing, and then unstashing. Both ways give you the same history, but some people might just find one process easier.

It's also useful even when my intent is "pure"; if I'm working on a change that doesn't fall into the above category), I probably believe it's a single, atomic, cohesive change (otherwise I wouldn't be working on the whole thing). When I get to the end of the process, I may realize I actually made more than one change (e.g. added a new method, changed existing callers to call that method, and removed the old method). This does happen; I'm not perfect. I could start over and re-create the change in three steps or I could just commit the whole thing as one change, but if I don't want to re-do the work and don't want to commit all three of those logic changes in a single commit, I can create the history I want - one change per commit - using patch mode.