The sound distributed version control system

#215 Don't spuriously update mtime

Closed on January 11, 2021
Ralith on December 11, 2020

pijul channel switch and pijul reset appear to update the mtime of (or entirely rewrite?) every file in the repository. This interacts poorly with external tools, e.g. causing rustc to do unnecessary work scanning and relinking unchanged crates, and causing direnv to reload the environment. Pijul should instead only rewrite files that are actually changed by a given operation.

pmeunier added a change on January 8, 2021
3KRGVQFUWFHPOGZOXVTJYNCM4XBRVYITAEOVPKBSAZ5GZIUO5KVQC
main
pmeunier on January 8, 2021

Hi! I finally found the time to fix this. The attached change is fairly large, because we now need to call output_repository_no_pending multiple times and we don’t want to output the same file multiple times, so the interface to output_repository_no_pending now needs to take an extra argument to remember that (that argument, a hash table, was previously allocated by the function itself).

Thanks again for the report!

pmeunier closed this discussion on January 8, 2021
Ralith on January 8, 2021

This doesn’t seem to be fixed. On a fresh clone, after pijul fork test, running pijul channel switch test/pijul channel switch main updates the mtime of every file.

Ralith reopened this discussion on January 8, 2021
pmeunier on January 8, 2021

Oh right, this was fixed only for pull, not for reset. Thanks for testing!

pmeunier on January 8, 2021

Oh right, this was fixed only for pull, not for reset. Thanks for testing!

pmeunier on January 10, 2021

I’ve just updated reset and record to:

  • During record, avoid diffing files that haven’t changed since the last diff or output.
  • During reset, avoid outputting files that haven’t changed since the last diff or output.
pmeunier closed this discussion on January 11, 2021