{"id":20673710,"url":"https://github.com/cpg314/mtime-rewind","last_synced_at":"2025-07-21T22:33:51.474Z","repository":{"id":192359013,"uuid":"686564085","full_name":"cpg314/mtime-rewind","owner":"cpg314","description":"Rewind the mtime of files whose mtime advanced since the last execution without a content change.","archived":false,"fork":false,"pushed_at":"2024-05-04T09:43:21.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T00:05:53.490Z","etag":null,"topics":["cache","cache-invalidation","cargo","mtime","rust"],"latest_commit_sha":null,"homepage":"https://c.pgdm.ch/code","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cpg314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-03T08:01:46.000Z","updated_at":"2024-08-04T18:15:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"88070f56-b005-4e9e-8070-190787657f76","html_url":"https://github.com/cpg314/mtime-rewind","commit_stats":null,"previous_names":["cpg314/mtime-rewind"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cpg314/mtime-rewind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpg314%2Fmtime-rewind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpg314%2Fmtime-rewind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpg314%2Fmtime-rewind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpg314%2Fmtime-rewind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cpg314","download_url":"https://codeload.github.com/cpg314/mtime-rewind/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpg314%2Fmtime-rewind/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266393197,"owners_count":23922326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cache-invalidation","cargo","mtime","rust"],"created_at":"2024-11-16T20:42:19.717Z","updated_at":"2025-07-21T22:33:51.450Z","avatar_url":"https://github.com/cpg314.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mtime-rewind\n\nRewind the `mtime` attribute of files whose modification advanced since the last execution without a content change.\n\nThis is useful to avoid unnecessary cache invalidations in systems using `mtime` to detect changes, for example [Rust's cargo](https://doc.rust-lang.org/cargo/) (see [this issue](https://github.com/rust-lang/cargo/issues/6529)).\n\nMore generally, see the [`mtime` comparison considered harmful blog post](https://apenwarr.ca/log/20181113).\n\n## Usage\n\n```console\n$ mtime-rewind\nRewind the mtime of files whose mtime advanced since the last execution without a content change\n\nUsage: mtime-rewind [OPTIONS] \u003cROOT\u003e\n\nArguments:\n  \u003cROOT\u003e\n\nOptions:\n      --dry   Do not edit only mtime, only list the changes that would be made\n  -h, --help  Print help\n\n```\n\n- The first execution will store hashes and modification times of files in a `.hashprint` file at the root. Hidden files and [cache directories](https://bford.info/cachedir/) are ignored.\n- Subsequent executions will rewind files that have not changed to the previous modification time, and update the modification times of other files if necessary.\n\nTypically, `mtime-rewind` can be executed as the first step of a CI build.\n\n## Example\n\n```console\n$ mtime-rewind ~/project\n[INFO mtime_rewind] Computing hashes...\n[INFO mtime_rewind] Computed hashes for 9 files\n[INFO mtime_rewind] Writing hashes for the first time...\n[INFO mtime_rewind] Wrote \"/root/project/.hashprint\"\n[INFO mtime_rewind] Done\n$ touch src/main.rs\n[INFO mtime_rewind] Computing hashes...\n[INFO mtime_rewind] Computed hashes for 9 files\n[INFO mtime_rewind] Restoring modification times for unchanged files...\n[INFO mtime_rewind] Loading cached state...\n[INFO mtime_rewind] Loaded hashes for 9 files\n[INFO mtime_rewind] Rewinding \"/root/project/src/main.rs\" from SystemTime { tv_sec: 1693727396, tv_nsec: 146042169 } to SystemTime { tv_sec: 1693727019, tv_nsec: 668108072 } as its contents did not change\n[INFO mtime_rewind] 1 files rewinded\n[INFO mtime_rewind] Saving the new state...\n[INFO mtime_rewind] Wrote \"/root/project/.hashprint\"\n[INFO mtime_rewind] Done\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpg314%2Fmtime-rewind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcpg314%2Fmtime-rewind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpg314%2Fmtime-rewind/lists"}