Skip to content

Add diff output to x-update-baseline - #2057

Merged
Billy O'Neal (BillyONeal) merged 5 commits into
microsoft:mainfrom
BillyONeal:add-diff-to-update-baseline
Aug 5, 2026
Merged

Add diff output to x-update-baseline#2057
Billy O'Neal (BillyONeal) merged 5 commits into
microsoft:mainfrom
BillyONeal:add-diff-to-update-baseline

Conversation

@BillyONeal

@BillyONeal Billy O'Neal (BillyONeal) commented Jul 7, 2026

Copy link
Copy Markdown
Member

This is a psuedo-alternative to #1980 or at least to get similar results as intended there.

I used GPT 5.5 in authoring this change.

PS C:\Dev\vcpkg-tool\src> C:\Dev\vcpkg-tool\out\build\Win-x64-Debug-WithArtifacts\vcpkg.exe x-update-baseline --dry-run --vcpkg-root C:\Dev\vcpkg 
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
updated registry 'https://github.com/microsoft/vcpkg': e03dc9b29710050cd1018bc5674688108658d327 -> 42e4e33e1505c9f47b58c21e0f557c1571b751ee
Updating baselines has resulted in the following version updates:

Direct dependencies:
curl: 8.20.0#1 -> 8.21.0#1

Transitive dependencies:
zlib: 1.3.2 -> 1.3.2#1

Copilot AI review requested due to automatic review settings July 7, 2026 01:24
.append_raw('\n')
.append_raw(Strings::trim(res.error()));
}
return paths.get_installed_lockfile()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change allows the same git fetch for the baseline update to be subsequently used by the dependency planner.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 enhances the x-update-baseline command to print a dependency version “diff” for manifest mode after baselines are updated, with a new --quiet switch to suppress that output. It also refactors remote git baseline resolution to reuse the installed lockfile fetch/update mechanism, and adds an end-to-end test suite covering the new diff output.

Changes:

  • Add manifest dependency version diff output (direct vs transitive) to vcpkg x-update-baseline plus --quiet to suppress it.
  • Switch remote registry baseline resolution to use LockFile::get_or_fetch() / ensure_up_to_date() rather than a direct git fetch call path.
  • Add PowerShell e2e coverage for the new output and quiet mode.

Reviewed changes

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

Show a summary per file
File Description
src/vcpkg/configuration.cpp Reworks remote registry latest-commit retrieval to go through the installed lockfile fetch/update flow.
src/vcpkg/commands.update-baseline.cpp Implements version snapshotting + diff printing for manifest dependencies and adds --quiet; updates command signature to accept triplets.
src/vcpkg/commands.cpp Moves x-update-baseline registration into the triplet-command tier to supply default/host triplets.
src/vcpkg/base/files.cpp Adjusts Windows exclusive lock file handle flags and documents POSIX flock/unlink inode considerations.
locales/messages.json Adds new messages for diff output sections and updates several existing strings used by the command.
include/vcpkg/commands.update-baseline.h Updates the command entrypoint signature to include default/host triplets.
include/vcpkg/base/message-data.inc.h Adds/updates message declarations used by the new output and switches.
include/vcpkg/base/contractual-constants.h Introduces SwitchQuiet constant for the new CLI switch.
azure-pipelines/end-to-end-tests-dir/update-baseline.ps1 New e2e tests validating diff output (direct/transitive), quiet mode, and no-diff behavior.

Comment thread src/vcpkg/commands.update-baseline.cpp
Comment thread src/vcpkg/commands.update-baseline.cpp
"{package_name} port manifest missing (no vcpkg.json or CONTROL file)")
DECLARE_MESSAGE(PortNotSupported, (msg::package_name, msg::triplet), "", "{package_name} is not supported on {triplet}")
DECLARE_MESSAGE(PortsNoDiff, (), "", "There were no changes in the ports between the two commits.")
DECLARE_MESSAGE(PortsNoDiff, (), "", "There were no changes in the ports.")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was actually wrong for portsdiff because sometimes the user only specifies one commit there

@vicroms Victor Romero (vicroms) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--quiet is doing a bit more than advertised (just suppressing output) by actually completely skipping the baseline comparison, but I don't feel strong enough about it to suggest making it a different option.

@BillyONeal

Billy O'Neal (BillyONeal) commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

by actually completely skipping the baseline comparison

Hmm that seems like a huge bug. Let me double check.

@vicroms

Copy link
Copy Markdown
Member

by actually completely skipping the baseline comparison

Hmm that seems like a huge bug. Let me double check.

I think it's fine. That feature is only useful when there's output and skipping it doesn't interfere with the actual "update the baseline" part.

@BillyONeal

Copy link
Copy Markdown
Member Author

I think it's fine. That feature is only useful when there's output and skipping it doesn't interfere with the actual "update the baseline" part.

Ohhh yeah in that case the comparison is only to print the output so it would be pointless to do without that.

@BillyONeal
Billy O'Neal (BillyONeal) merged commit 8936e0b into microsoft:main Aug 5, 2026
7 checks passed
@BillyONeal
Billy O'Neal (BillyONeal) deleted the add-diff-to-update-baseline branch August 5, 2026 21:35
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.

3 participants