Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove transitive dependencies already included by other projects #9685

Merged
merged 1 commit into from Oct 26, 2021

Conversation

pmiossec
Copy link
Member

and found by snitch tool https://github.com/spectresystems/snitch

snitch GitExtensions.sln

(projects with only dependency global Microsoft.VisualStudio.Threading have been removed)

┌─────────────────────────────────────────────────────────────────────────────────┐
│ Packages that can be removed from GitUI: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ System.IO.Abstractions │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│ │
│ Packages that can be removed from GitExtensions.Plugins.AutoCompileSubmodules: │
│ ┌───────────────────────────────────────────────┬─────────────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├───────────────────────────────────────────────┼─────────────────────────────┤ │
│ │ Microsoft.VisualStudio.Composition │ GitUIPluginInterfaces │ │
│ │ System.Reactive.Interfaces │ GitUIPluginInterfaces │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └───────────────────────────────────────────────┴─────────────────────────────┘ │
│ │
│ Packages that can be removed from TeamCityIntegration: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ System.Reactive.Linq │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│ │
│ Packages that can be removed from GitExtensions.Plugins.Bitbucket: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│ │
│ Packages that can be removed from JenkinsIntegration: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json │ GitCommands │ │
│ │ System.Reactive.Linq │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│ │
│ Packages that can be removed from AppVeyorIntegration: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json │ GitCommands │ │
│ │ System.Reactive.Linq │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│ │
│ Packages that can be removed from GitCommands.Tests: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│ │
│ Packages that can be removed from GitUI.Tests: │
│ ┌─────────────────────────────────────────────────────┬───────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├─────────────────────────────────────────────────────┼───────────────────────┤ │
│ │ System.IO.Abstractions │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ ConEmuWinForms │ │
│ └─────────────────────────────────────────────────────┴───────────────────────┘ │
│ │
│ Packages that can be removed from AzureDevOpsIntegration: │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package │ Referenced by │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json │ GitCommands │ │
│ │ System.Reactive.Linq │ GitCommands │ │
│ │ Microsoft.VisualStudio.Threading │ GitExtUtils │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘

Test methodology

  • Nothing really changed....

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

and found by snitch tool https://github.com/spectresystems/snitch

`snitch GitExtensions.sln`

(prjects with only dependency global `Microsoft.VisualStudio.Threading` have been removed

┌─────────────────────────────────────────────────────────────────────────────────┐
│  Packages that can be removed from GitUI:                                       │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ System.IO.Abstractions                               │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from GitExtensions.Plugins.AutoCompileSubmodules: │
│ ┌───────────────────────────────────────────────┬─────────────────────────────┐ │
│ │ Package                                       │ Referenced by               │ │
│ ├───────────────────────────────────────────────┼─────────────────────────────┤ │
│ │ Microsoft.VisualStudio.Composition            │ GitUIPluginInterfaces       │ │
│ │ System.Reactive.Interfaces                    │ GitUIPluginInterfaces       │ │
│ │ Microsoft.VisualStudio.Threading              │ GitExtUtils                 │ │
│ └───────────────────────────────────────────────┴─────────────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from TeamCityIntegration:                         │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ System.Reactive.Linq                                 │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from GitExtensions.Plugins.Bitbucket:             │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json                                      │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from JenkinsIntegration:                          │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json                                      │ GitCommands          │ │
│ │ System.Reactive.Linq                                 │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from AppVeyorIntegration:                         │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json                                      │ GitCommands          │ │
│ │ System.Reactive.Linq                                 │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from GitCommands.Tests:                           │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json                                      │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from GitUI.Tests:                                 │
│ ┌─────────────────────────────────────────────────────┬───────────────────────┐ │
│ │ Package                                             │ Referenced by         │ │
│ ├─────────────────────────────────────────────────────┼───────────────────────┤ │
│ │ System.IO.Abstractions                              │ GitCommands           │ │
│ │ Microsoft.VisualStudio.Threading                    │ ConEmuWinForms        │ │
│ └─────────────────────────────────────────────────────┴───────────────────────┘ │
│                                                                                 │
│  Packages that can be removed from AzureDevOpsIntegration:                      │
│ ┌──────────────────────────────────────────────────────┬──────────────────────┐ │
│ │ Package                                              │ Referenced by        │ │
│ ├──────────────────────────────────────────────────────┼──────────────────────┤ │
│ │ Newtonsoft.Json                                      │ GitCommands          │ │
│ │ System.Reactive.Linq                                 │ GitCommands          │ │
│ │ Microsoft.VisualStudio.Threading                     │ GitExtUtils          │ │
│ └──────────────────────────────────────────────────────┴──────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
@ghost ghost assigned pmiossec Oct 25, 2021
@pmiossec
Copy link
Member Author

Notes:

  • The displayed table render better in GitExtensions ;)
  • A little cleaning but no huge added value as the version is managed globally (a we could not end up with 2 projects using different versions of a package). If you consider that it doesn't worth it, feel free to close the PR...

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

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

+1

@@ -5,7 +5,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
Copy link
Member

Choose a reason for hiding this comment

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

You'd find that below we have the following code:

  <ItemGroup>
    <PluginAssembly Include="$([System.IO.Path]::Combine('$(TargetDir)', 'Newtonsoft.Json.dll'))" />
  </ItemGroup>

If we remove this line this entry becomes very difficult to reason about... I don't have a good suggestion atm, just making a note.

I wonder if we can get away from using Newtonsoft.Json.dll at all and use System.Text.Json API instead. But this is a completely different story...

@RussKie RussKie merged commit 3ec4039 into gitextensions:master Oct 26, 2021
@ghost ghost added this to the vNext milestone Oct 26, 2021
@pmiossec pmiossec deleted the trim_dependencies branch October 26, 2021 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants