Skip to content

fix(diff): show submodules as a summary row and never mark them reviewed - #403

Merged
umputun merged 2 commits into
masterfrom
gitlink-not-reviewable
Oct 21, 2026
Merged

umputun merged 2 commits into
masterfrom
gitlink-not-reviewable

Conversation

@umputun

@umputun umputun commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Implements the part of #350 agreed in the thread: a submodule is explicit in the UI and never counts as reviewed source content. Recursive submodule support stays out, as discussed there. Git only; hg and jj are unchanged.

  • One summary row per submodule. The git renderer replaces the Subproject commit add/remove rows with a single placeholder row flagged IsSubmodule: moved pointer, new or deleted submodule, a rename with the pointer unchanged, or an unresolved merge conflict. The rows alone cannot tell a submodule from a regular file holding that text, so the 160000 gitlink mode is confirmed through git diff --raw for the same comparison. A dirty submodule whose pointer has not moved carries no mode in its patch, which is why the patch alone is not enough. --submodule=short keeps a diff.submodule=log setting from changing the rows.
  • No +1 -1 per submodule. The row is a context placeholder, so it adds nothing to the counts or the review stats.
  • Never marked reviewed. Space on a submodule is refused with a status-bar hint on every path: the displayed file, a file not loaded yet, and a file loaded earlier. A mark it already held is dropped when it loads.
  • Only pointer-row diffs, empty renames and combined conflict patches pay the extra --raw call; ordinary empty diffs do not.

Tests build real superprojects: moved, dirty-unmoved, added, deleted, renamed, against a ref, with diff.submodule=log, and an unresolved merge conflict; a regular file holding pointer text stays a normal diff; the UI refusal is covered on all three marking paths.

Fixed #350

A submodule change rendered as ordinary "Subproject commit" add/remove rows,
so each submodule scored +1 -1 and could be marked reviewed, with the mark
surviving a reload. The git renderer now replaces those rows with one
placeholder row flagged IsSubmodule, after confirming the 160000 gitlink mode
through git diff --raw for the same comparison; the rows alone cannot tell a
submodule from a regular file holding that text, and a dirty submodule whose
pointer has not moved carries no mode in its patch. --submodule=short keeps a
diff.submodule=log setting from changing the rows.

The row is a context placeholder, so it adds nothing to the counts. Marking a
submodule reviewed is refused with a status-bar hint on every path: the
displayed file, a file not loaded yet, and a file loaded earlier.

Fixed #350
An empty diff counted as a possible submodule, so every untracked, staged-only
or mode-only file paid an extra git diff --raw call. Empty parsed diffs now
trigger the raw check only for renames or combined merge-conflict patches. An
unresolved submodule merge conflict was labelled "pointer
unchanged"; it now reads as an unresolved merge conflict and stays
unreviewable. A test also pins that a key press clears the refusal hint.
Copilot AI balanced review requested due to automatic review settings October 21, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying revdiff with  Cloudflare Pages  Cloudflare Pages

Latest commit: d21a311
Status: ✅  Deploy successful!
Preview URL: https://303de79f.revdiff.pages.dev
Branch Preview URL: https://gitlink-not-reviewable.revdiff.pages.dev

View logs

@umputun
umputun merged commit 185abe3 into master Oct 21, 2026
7 checks passed
@umputun
umputun deleted the gitlink-not-reviewable branch October 21, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants