2 ms·
Does that really matter all that much, though? Often enough, I make a bunch of changes to a repo, but want to split those changes across multiple commits. Whe
by kelnos 3y ago
Does that really matter all that much, though? Often enough, I make a bunch of changes to a repo, but want to split those changes across multiple commits. When I'm staging changes before I make a commit, I'm doing so by looking at the diff (via 'git add -p'). By that point I don't really have any memory of how I made those changes; I don't recall details like "I deleted this line, and then typed this other line in its place", or "I deleted these characters and replaced them with these others", or "I added these characters to an existing line". Ultimately, when I'm looking at it, the diff that git generates is the change, to me.
And yes, I get that there's no "the" diff; git could change its algorithm between versions, and the diffs between commits might change (even though the end results of those diffs would be the same). But ultimately I don't really care about that. My overall thoughts about the change are qualitative, and are represented by what I put in the commit message. Whether the diff is represented as "3 deleted lines, then 4 added lines, and finally 1 deleted line", or "2 deleted lines, then 4 added lines, and finally 2 deleted lines" (or whatever) is pretty irrelevant to me.
- 8organicbits 3y agoI think tracking the "how" of a change can help with review. Currently I see 40 lines deleted in this file and 40 added in another. If this was a "cut and paste" then I may not need to review the code as deeply as it's not new, but I'd focus on if it works in the new location.