AffectedModuleDetector icon indicating copy to clipboard operation
AffectedModuleDetector copied to clipboard

Renames across module boundaries don't mark both modules as changed.

Open alexrwegener opened this issue 1 year ago • 1 comments

Using --name-only for git diff only shows the path for the new location.

To test:

  • Commit a rename across a module boundary (old-module -> new-module for this example)
  • git --no-pager diff --name-only -M95 origin/main..HEAD

You'll see something like

new-module/src/main/kotlin/com/example/Renamed.kt

AMD does not mark both modules (old-module and new-module) as changed.

A fix could be switching from --name-only to --name-status. Using the same rename commit as before:

  • Run git --no-pager diff --name-status -M95 origin/main..HEAD

You'll see something like

R100	old-module/src/main/kotlin/com/example/Old.kt		new-module/src/main/kotlin/com/example/Renamed.kt

alexrwegener avatar Mar 19 '24 13:03 alexrwegener

I believe an alternative is to change -M95 to --no-renames. It will list both the old and new file paths in the output that way.

bddckr avatar Mar 30 '25 09:03 bddckr