4 ms·
Yes! I find `git diff` to be the most annoying thing about git. I can be pretty forgiving of the clunky UX, but the diff output is just wrong. People often say
by dahfizz 4y ago
Yes! I find `git diff` to be the most annoying thing about git. I can be pretty forgiving of the clunky UX, but the diff output is just wrong.
People often say of git, "The porcelain is bad but the plumbing is good". The opposite is true for digging, IMO.
- sangnoir 4y agoFortunately, git permits the use of external difftools. One can easily configure git to use their preferred semantic diff tool and git wouldn't even care. The plumbing is excellent.
- account42 4y agoWell, `git diff` is part of the porcelain. The git model doesn't work on diffs, it works with complete trees (sometimes stored as deltas, but that is an implementation detail). Diffs are for the user because they make it easier to see the difference compared to just having the old and new copy show. There is nothing preventing git diff from being changed to use semantic information when calculating the diffs shown.
- butterNaN 4y agoI have configured git to use `vimdiff`, based on advise I saw on the Internet some time ago: git config --global diff.tool vimdiff git config --global difftool.prompt false Typing `git difftool` yields the expected behavior. :qa in vim cycles to the next file in the changeset without saving anything. Also, by default, git calls vimdiff with the -R option. You can override it with git config --global difftool.vimdiff.cmd 'vimdiff "$LOCAL" "$REMOTE"' This will open vimdiff in writeable mode which allows edits while diffing. :wq in vim cycles to the next file in the changeset with changes saved.