JakeWharton / dependency-tree-diff

An intelligent diff tool for the output of Gradle's dependencies task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't show diff for common subtrees

JakeWharton opened this issue · comments

 +--- com.google.firebase:firebase-perf:18.0.0
-|    \--- com.squareup.okhttp3:okhttp:3.0.0 -> 4.8.0
-|         +--- com.squareup.okio:okio:2.7.0
-|         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.70 -> 1.3.72 (*)
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.70 -> 1.3.72
-|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)
+|    \--- com.squareup.okhttp3:okhttp:3.0.0 -> 4.8.1
+|         +--- com.squareup.okio:okio:2.7.0
+|         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.70 -> 1.3.72 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.70 -> 1.3.72
+|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)

should be

 +--- com.google.firebase:firebase-perf:18.0.0
-|    \--- com.squareup.okhttp3:okhttp:3.0.0 -> 4.8.0
+|    \--- com.squareup.okhttp3:okhttp:3.0.0 -> 4.8.1
 |         +--- com.squareup.okio:okio:2.7.0
 |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.70 -> 1.3.72 (*)
 |         |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.70 -> 1.3.72
 |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 (*)

assuming we want to show subtrees for changed nodes.

Otherwise we just show it as a changed leaf.

My first thought here is to split the coordinates into group/artifact and version parts. Then we can disambiguate when a node is for the same group/artifact pair and then choose how to handle their subtree.