Skip to content

Commit

Permalink
Add deprecation notice for old nix hash conversion subcommands.
Browse files Browse the repository at this point in the history
(But not yet nix-hash since `nix hash` is still hidden behind a feature flag.)

NixOS#8876
  • Loading branch information
kolloch committed Nov 28, 2023
1 parent 9762566 commit dd35713
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nix/hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct CmdToBase : Command

void run() override
{
warn("The old format conversion sub commands of `nix hash` where deprecated in favor of `nix hash convert`.");
for (auto s : args)
logger->cout(Hash::parseAny(s, ht).to_string(hashFormat, hashFormat == HashFormat::SRI));
}
Expand Down Expand Up @@ -213,6 +214,9 @@ static auto rCmdHash = registerCommand<CmdHash>("hash");
/* Legacy nix-hash command. */
static int compatNixHash(int argc, char * * argv)
{
// Wait until `nix hash convert` is not hidden behind experimental flags anymore.
// warn("`nix-hash` has been deprecated in favor of `nix hash convert`.");

std::optional<HashAlgorithm> ha;
bool flat = false;
HashFormat hashFormat = HashFormat::Base16;
Expand Down

0 comments on commit dd35713

Please sign in to comment.