umputun / umputun/revdiff

Changes inside git submodules are not shown, only the "Subproject commit" pointer

Open
#350 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
881
Forks
90
Avg merge
14h 29m
Merged PRs (30d)
21

Description

Problem

I work in a meta-repo: the root has no code of its own, just 11 git submodules
(one per service). All real changes happen inside the submodules.

When I run revdiff at the root, or when the Claude Code plugin launches it there
(detect-ref.sh sees uncommitted changes and starts a working-tree review), the
tree lists each submodule as one entry and the diff pane shows only this:

- Subproject commit e4347a2ade4e6be9f80f9b639a92cec6a2e65548
+ Subproject commit 8b9959542690ad9ddf75cdc4f0963779d8b810e0-dirty

There is nothing to annotate, so the review silently covers none of the actual
changes. That is the part that bites: revdiff looks like it worked, the agent
thinks the review happened, and not a single changed line was on screen.

Piping a hand-built diff into revdiff --stdin works around it, but the plugin
flow cannot know to do that: the launcher runs revdiff in the current directory
and has no way to tell that the diff it got is only gitlink pointers.

revdiff v1.12.0, git 2.55.0, macOS.

Where it comes from

revdiff builds the file list from git diff --name-status, and git never expands
submodules there, not even with --submodule=diff. So each submodule is one
160000-mode entry and the per-file diff for it is the one-line pointer change.

Proposed solution

When a --name-status entry is a gitlink, run git inside that submodule and add
the resulting files to the tree with the submodule path as prefix. The base
follows what git diff --submodule=diff already does: pinned SHA against the
submodule's working tree in working-tree mode, the two gitlink SHAs in ref mode.
The existing per-file loading and editor integration keep working unchanged.

Opt-in behind a flag, --recurse-submodules to match git's own naming for the
same behaviour, so nothing changes for repos without submodules.

If you would rather keep the core as is, a smaller option is to teach the
launcher script to notice a gitlink-only diff and fall back to piping a
per-submodule diff into revdiff --stdin. Something like
git submodule foreach --quiet 'git diff --src-prefix=a/$sm_path/ --dst-prefix=b/$sm_path/'
already produces root-relative paths that the stdin parser handles as is.

Happy to do either, or to hear that this is out of scope.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how git diff --name-status feeds the file list and how detect-ref.sh launches working-tree reviews. Compare the existing --stdin path with the per-file loading and editor integration, then verify behavior for gitlink entries in working-tree and ref modes. Done means submodule changes appear under their prefixed paths without changing behavior for repositories without submodules.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
cli, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.