Skip to content

Add the darc vmr diff --name-only option #4880

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

Merged
merged 3 commits into from
May 23, 2025

Conversation

premun
Copy link
Member

@premun premun commented May 23, 2025

Adds a new option that only lists the differing file names

dotnet/source-build#5201

@Copilot Copilot AI review requested due to automatic review settings May 23, 2025 11:17
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new --name-only flag to the darc vmr diff command so users can list just the changed file names instead of full diffs.

  • Defines a NameOnly boolean option in the command-line options class.
  • Updates the diff operation to branch on options.NameOnly, outputting either file names or full diffs.
  • Wraps the diff logic in a try/finally to ensure the temporary directory is always cleaned up.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Microsoft.DotNet.Darc/Darc/Options/VirtualMonoRepo/VmrDiffOptions.cs Add --name-only option to the VMR diff verb
src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/VmrDiffOperation.cs Implement name-only output path and console logic, adjust diff and cleanup flow
Comments suppressed due to low confidence (2)

src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/VmrDiffOperation.cs:290

  • Add unit or integration tests for the new --name-only flag, covering both console output and writing to options.OutputPath, to verify correct behavior.
if (options.NameOnly)

src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/VmrDiffOperation.cs:288

  • The removal of the if (!string.IsNullOrEmpty(tmpDirectory)) guard causes full diffs to always be printed to stdout even when an output path is provided. Reintroduce an output-path check in the regular diff branch to correctly save diffs to files when options.OutputPath is set.
try

@premun premun merged commit e52690a into dotnet:main May 23, 2025
9 checks passed
@premun premun deleted the prvysoky/names-only branch May 23, 2025 14:58
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.

2 participants