[Nix#9359] nix fmt
formats files in .git, leading to a corrupted repository #101
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#101
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#9359
Describe the bug
If you make a git branch/tag whose name ends in .nix, git creates files like
.git/refs/heads/add-stuff-to-default.nix
that don't contain nix code but end up being "formatted" bynix fmt
anyway. This leads to a corrupted git repository and very confusing messages like:Steps To Reproduce
git switch -C add-stuff-to-default.nix
nix fmt
Expected behavior
I think
nix fmt
should entirely ignore.git
. Perhaps it should also skip gitignored stuff, but I'm not sure.nix-env --version
outputnix-env (Nix) 2.13.6