denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

Only update .json if fields updated #108

Closed gjost closed 6 years ago

gjost commented 6 years ago

Currently object JSON files are updated whenever Object.write or .save is called. This results in many unnecessary commits, and makes it tedious for users to determine when actual changes were made.

Before writing, DDR should load the existing file, make a copy of the JSON to save, remove certain fields (object metadata, record_created, record_lastmod) from both JSONs, and compare them. Only save if there are actual changes.

gjost commented 6 years ago

Fixed in 1dd04ba.