Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix flakes metadata displays lastModified timestamp of inputs #7729

Conversation

wfranzini
Copy link
Contributor

Motivation

IMHO the input's last modified timestamps is more useful than the timestamp of the lockfile.

Context

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or bug fix: updated release notes

IMHO the input's last modified timestamps is more useful than the
timestamp of the lockfile.
prefix + (last ? treeLast : treeConn), input.first,
(*lockedNode)->lockedRef);
(*lockedNode)->lockedRef,
std::put_time(std::localtime(&*lastModified), "%F %T"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will crash if lastModified is empty. You could use the describe() method in lockfile.cc, which does the following:

    auto s = fmt("'%s'", flakeRef.to_string());

    if (auto lastModified = flakeRef.input.getLastModified())
        s += fmt(" (%s)", std::put_time(std::gmtime(&*lastModified), "%Y-%m-%d"));

wentasah added a commit to wentasah/nix that referenced this pull request Jul 9, 2023
@wentasah
Copy link
Contributor

wentasah commented Jul 9, 2023

@wfranzini Do you plan to finish this PR? Feel free to take inspiration (or reuse) wentasah@8702614.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants