libfetchers/git-utils: Be more correct about validating refnames#14253
Merged
libfetchers/git-utils: Be more correct about validating refnames#14253
Conversation
Contributor
Author
|
Needs a bit more work |
This comment was marked as outdated.
This comment was marked as outdated.
edolstra
reviewed
Oct 15, 2025
Turns out there's a much better API for this that doesn't have the footguns of the previous method. isLegalRefName is somewhat of a misnomer, since it's mainly used to validate user inputs that can be either references, branch names, psedorefs or tags.
5b96c54 to
5d1178b
Compare
edolstra
approved these changes
Oct 15, 2025
|
Successfully created backport PR for |
|
Successfully created backport PR for |
13 tasks
philiptaron
added a commit
to philiptaron/nixpkgs
that referenced
this pull request
Jan 8, 2026
## Bug fixes (crashes) - Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154) - Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086) - Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137) - Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729) - Fix crash on flakerefs containing newlines (NixOS/nix#14450) ## Bug fixes (functionality) - Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150) - Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515) - Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531) - Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792) - Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729) - `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861) - Fix filesystem ops in store optimization (NixOS/nix#14676) ## Bug fixes (output) - Fix double-quoting of paths in logs (NixOS/nix#14210) - Include path in world-writable error messages (NixOS/nix#14785) ## Improvements - Better git refnames validation (NixOS/nix#14253) - Use pure/restricted eval for help pages (NixOS/nix#14156) - Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134) - Correct `build-dir` error in manual (NixOS/nix#14745) ## Build system - Add mdbook 0.5 support (NixOS/nix#14690) - Drop legacy Apple SDK pattern (NixOS/nix#13976) https://github.com/NixOS/nix/releases/tag/2.31.3
philiptaron
added a commit
to philiptaron/nixpkgs
that referenced
this pull request
Jan 8, 2026
Changelog of fixes: ## Bug fixes (crashes) - Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154) - Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086) - Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137) - Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729) - Fix crash on flakerefs containing newlines (NixOS/nix#14450) ## Bug fixes (functionality) - Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150) - Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515) - Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531) - Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792) - Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729) - `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861) - Fix filesystem ops in store optimization (NixOS/nix#14676) ## Bug fixes (output) - Fix double-quoting of paths in logs (NixOS/nix#14210) - Include path in world-writable error messages (NixOS/nix#14785) ## Improvements - Better git refnames validation (NixOS/nix#14253) - Use pure/restricted eval for help pages (NixOS/nix#14156) - Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134) - Correct `build-dir` error in manual (NixOS/nix#14745) ## Build system - Add mdbook 0.5 support (NixOS/nix#14690) - Drop legacy Apple SDK pattern (NixOS/nix#13976) https://github.com/NixOS/nix/releases/tag/2.31.3
13 tasks
philiptaron
added a commit
to philiptaron/nixpkgs
that referenced
this pull request
Jan 15, 2026
Changelog of fixes: ## Bug fixes (crashes) - Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154) - Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086) - Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137) - Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729) - Fix crash on flakerefs containing newlines (NixOS/nix#14450) ## Bug fixes (functionality) - Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150) - Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515) - Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531) - Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792) - Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729) - `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861) - Fix filesystem ops in store optimization (NixOS/nix#14676) ## Bug fixes (output) - Fix double-quoting of paths in logs (NixOS/nix#14210) - Include path in world-writable error messages (NixOS/nix#14785) ## Improvements - Better git refnames validation (NixOS/nix#14253) - Use pure/restricted eval for help pages (NixOS/nix#14156) - Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134) - Correct `build-dir` error in manual (NixOS/nix#14745) ## Build system - Add mdbook 0.5 support (NixOS/nix#14690) - Drop legacy Apple SDK pattern (NixOS/nix#13976) https://github.com/NixOS/nix/releases/tag/2.31.3
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.
Motivation
Turns out there's a much better API for this that doesn't have the
footguns of the previous method.
isLegalRefNameis somewhat of a misnomer, since it's mainly used tovalidate user inputs that can be either references, branch names,
psedorefs or tags.
Context
Resolves #14252
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.