Add spack repo update command#50868
Merged
tgamblin merged 40 commits intospack:developfrom Jun 19, 2025
Merged
Conversation
haampie
reviewed
Jun 9, 2025
alecbcs
commented
Jun 9, 2025
haampie
reviewed
Jun 9, 2025
alecbcs
commented
Jun 9, 2025
alecbcs
commented
Jun 9, 2025
haampie
reviewed
Jun 9, 2025
haampie
reviewed
Jun 9, 2025
haampie
reviewed
Jun 9, 2025
haampie
reviewed
Jun 10, 2025
haampie
reviewed
Jun 10, 2025
b2dc486 to
c86d2a9
Compare
c91c3dc to
97f731b
Compare
haampie
reviewed
Jun 11, 2025
haampie
reviewed
Jun 11, 2025
9cedc79 to
67ab283
Compare
tgamblin
approved these changes
Jun 19, 2025
haampie
reviewed
Jun 19, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new "spack repo update" command to support updating remote Git repositories and switching between branches, tags, or commits. Key changes include new completions for Fish and Bash shells, extended Git utility functions and tests for repository management, and corresponding updates to configuration schema and command parsing.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| share/spack/spack-completion.fish | Added update completion for spack repo update command |
| share/spack/spack-completion.bash | Updated Bash completion to include the new update command |
| lib/spack/spack/util/git.py | Introduced new Git helper functions for repo updates |
| lib/spack/spack/test/util/git.py | Added tests for the new Git repository initialization and checkout |
| lib/spack/spack/test/repo.py | Expanded tests to exercise repo update functionality |
| lib/spack/spack/test/cmd/repo.py | Added new tests for repo update flags and invalid configurations |
| lib/spack/spack/schema/repos.py | Updated repos.yaml schema to include branch, tag, and commit keys |
| lib/spack/spack/repo.py | Added update functionality to RemoteRepoDescriptor and updated repo command logic |
| lib/spack/spack/cmd/repo.py | Added the repo update subcommand with mutually exclusive refspec options |
Comments suppressed due to low confidence (1)
lib/spack/spack/test/cmd/repo.py:721
- Using os.path.join with a single argument is redundant; consider simply calling os.makedirs('.git') for improved readability.
)
tgamblin
added a commit
that referenced
this pull request
Jun 19, 2025
Add asserts missing in #50868.
haampie
pushed a commit
that referenced
this pull request
Jun 19, 2025
Add asserts missing in #50868.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new spack repo update command that allows users to update remote Git repositories and switch between branches, tags, or commits in their Spack repository configuration.
This PR also adds optional branch, tag, and commit keys to a git repository's configuration in
repos.yaml.repos.yaml:If multiple keys are specified they are prioritized
commit>tag>branch.