Search code examples
gitvisual-studio-codediffmeld

A commit introduced breaking changes across many submodules. What is a visual tool I can use to compare previous commits in all submodules?


When commits introduce breaking changes across many submodules, after I restore to a working state, I'm yet to figure out the best process and visual tool to diff an entire tree and submodules to introduce fixes, and I'd like to find out how to resolve it well.

I primarily use vscode on mac as an editor, and gitlens seems to not provide information on all the submodules with a comparison between two commits. on Linux, my approach would be to checkout to two different folders and use the program 'meld' to visually compare two trees. This is simple and works pretty well, but I'd like to find another way that wouldn't involve having two seperate checkouts of the tree to different folders, and instead use the commit history directly.

Meld is also available on mac os, but it cannot undo on my install and errors.

Another option I tried was to use git diff with vscode as an external editor, but my attempt with this only brings up the commit in the root module into vscode, and then ceases to present more.

git difftool aa77184152c14e99f3ca94c45023bcda1206f8d1 --submodule=diff

This type of action does present all the submodule diff information in the shell, but not in the external code editor.

git diff 3b65611912a8f95719337c64cf048258c855d1f8 --submodule=diff

Solution

  • You can create a second checkout of your repo (using git worktree for example), and use a regular diff tool (like meld) to compare both directories on disk.