Add diff output to x-update-baseline - #2057
Conversation
| .append_raw('\n') | ||
| .append_raw(Strings::trim(res.error())); | ||
| } | ||
| return paths.get_installed_lockfile() |
There was a problem hiding this comment.
This change allows the same git fetch for the baseline update to be subsequently used by the dependency planner.
There was a problem hiding this comment.
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-baselineplus--quietto 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. |
| "{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.") |
There was a problem hiding this comment.
It was actually wrong for portsdiff because sometimes the user only specifies one commit there
Victor Romero (vicroms)
left a comment
There was a problem hiding this comment.
--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.
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. |
Ohhh yeah in that case the comparison is only to print the output so it would be pointless to do without that. |
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.