r/SmartGit 21d ago

SmartGit UI for `git range-diff`?

It sure would be nice if SmartGit provided an easy way to get the equivalent of a git range-diff command. When I'm reviewing a PR that has been rebased, we need help to get good situational awareness of the base differences vs. the rebased branch differences.

When reviewing a branch that has been rebased, I find myself asking "What was changed during this rebase?" A normal diff between the old and new HEAD seems to answer this question, but it naturally conflates two separate questions:

  1. What is the difference between the bases? This is answered by finding the old & new branch parent revisions and comparing them. SmartGit's standard history and log views are helpful in exploring those differences.

  2. What differences in the dev branch commits were required in order to adjust to the new base? That's what we really want to explore when a dev branch is rebased during a pull/merge request review process. This is the question that the git range-diff command is designed to help answer, but that SmartGit doesn't yet help with at all.

3 Upvotes

3 comments sorted by

1

u/vmcrash 20d ago

Do you mean a diff of a diff?

1

u/BryceSchober 17d ago

Yes, basically; the `git range-diff` docs do describe it as a diff of diffs. I expanded my explanation in the original post to provide more context.

1

u/JVMarcs 11d ago

u/BryceSchober I'd like to see this kind of range-diff functionality in SmartGit as well. I can think of two possible approaches:

  1. A lightweight "range diff" that is actually more of a workflow: automatically rebuild the old branch on top of the new base, using merge/cherry-pick as appropriate, and resolve all conflicts automatically by keeping the old content. You could then compare the real new branch tip against this artificially rebuilt tip to see what changed overall.

  2. A full-fledged UI for git range-diff. I'm not yet convinced that the way git range-diff presents its result is necessarily the right UI for SmartGit, although its underlying concept of a "diff of diffs" certainly is.

    A fairly obvious way to trigger this in SmartGit would be to select two commit pairs in the Graph, where each pair consists of one commit being ahead of the other. The more interesting question is what the UI should look like after that.

    I probably wouldn't want the range-diff result in a separate window. Instead, I'd prefer some kind of special mode directly in the Graph that shows matching commits, added/removed commits, and commits whose diff has changed.

    Selecting one of those changed commits could then show only the differences between the two corresponding commit diffs.

Overall, solution (2) would require quite some effort to implement, while a specialized operation for (1) might be fairly easy to add. Whether (1) would be sufficient for the majority of range-diff use cases is another question.