Skip to content

Add default behavior for darc vmr diff command#5184

Merged
premun merged 5 commits intomainfrom
copilot/fix-5183
Aug 25, 2025
Merged

Add default behavior for darc vmr diff command#5184
premun merged 5 commits intomainfrom
copilot/fix-5183

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 22, 2025

This PR implements default behavior for the darc vmr diff command to eliminate the need for custom scripts when diffing against all repositories in a VMR.

Changes Made

Core Implementation:

  • Made the Repositories parameter optional in VmrDiffOptions
  • Added default behavior when no repository arguments are provided and called from a VMR directory
  • Implemented smart detection to distinguish between mapping names (like "arcade") and URI/path arguments

New Functionality:

  1. Default Multi-Repo Diff: When called without arguments from a VMR directory, automatically diffs against all repositories listed in source-manifest.json
  2. Single Mapping Support: Single arguments like darc vmr diff arcade are detected as mapping names and diff only that specific repository
  3. Formatted Output: With --name-only, displays organized sections per repository with progress indicators
  4. Silent Full Diff: Without --name-only, outputs complete diff content silently for programmatic use

Usage Examples

# Diff all repositories in VMR with readable output
darc vmr diff --name-only

# Diff all repositories with full diff output (silent)
darc vmr diff

# Diff specific repository by mapping name
darc vmr diff arcade --name-only

# Existing URI/path syntax still works
darc vmr diff https://github.com/dotnet/arcade:main

Output Format

With --name-only flag, the output matches the format from the PowerShell script:

[1/5] Diffing arcade / abc123...
--------------------------------------------------------------------------------
+ src/new-file.cs
* src/modified-file.cs
================================================================================

[2/5] Diffing runtime / def456...
--------------------------------------------------------------------------------
(No differences found)
================================================================================

Backward Compatibility

All existing functionality is preserved. The change only adds new behavior when no repository arguments are provided, making the parameter optional without breaking existing usage patterns.

Fixes #5183.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits August 22, 2025 11:34
…tation

Co-authored-by: premun <7013027+premun@users.noreply.github.com>
Co-authored-by: premun <7013027+premun@users.noreply.github.com>
Copilot AI changed the title [WIP] Add default behaviour for darc vmr diff Add default behavior for darc vmr diff command Aug 22, 2025
Copilot AI requested a review from premun August 22, 2025 11:40
Co-authored-by: premun <7013027+premun@users.noreply.github.com>
Copilot AI requested a review from premun August 25, 2025 07:33
@premun premun marked this pull request as ready for review August 25, 2025 08:07
Copilot AI review requested due to automatic review settings August 25, 2025 08:07
Copy link
Copy Markdown
Contributor

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

This PR implements default behavior for the darc vmr diff command to allow diffing against all repositories in a VMR without requiring explicit arguments. The changes enable smart detection of mapping names versus URI/path arguments and provide organized output formatting.

Key changes:

  • Made the Repositories parameter optional in VmrDiffOptions
  • Added multi-repository diff functionality when no arguments are provided from a VMR directory
  • Implemented smart detection to distinguish between mapping names and URI/path arguments

Reviewed Changes

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

File Description
VmrDiffOptions.cs Made Repositories parameter optional and updated nullable annotations
VmrDiffOperation.cs Added comprehensive default behavior logic with multi-repo and single mapping support

…iffOperation.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@premun premun merged commit 1514de7 into main Aug 25, 2025
9 checks passed
@premun premun deleted the copilot/fix-5183 branch August 25, 2025 11:37
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.

Add default behaviour for darc vmr diff

4 participants