I'm not sold on this. While I do think it's a pain that even touching an MS Word doc will cause differences even if nothing is actually changed allowing something like this would make it easy for someone to commit differences that shouldn't be by accident.
I do agree that the user should always be reviewing changes and be aware of what they are accepting. In an ideal world, there might be an interactive version of rake like jest that shows the diff and prompts whether to update the snapshot:
But Jest also offers the command line option as well, similar to this. It still requires explicitly adding the env variable to change behavior, so I think it's not that likely to happen on accident. Perhaps if you re-ran a command, but that could also happen if you were using a
xargs pipeline or something else like you propose.
xargs could accomplish the same thing, but requires the user know an additional language (not everyone is familiar with shell scripting, or even uses a platform with a unix shell) and figure out/remember some undocumented commands that might break if the test output format changes. Using the pipe also obscures other results of the tests themselves.
This adds very little new to code to the project and makes it very easy to use without needing to know any shell language.
We've been using this in our own project that uses sablon for 6 months now and have been very happy with it; we've not accidentally committed any wanted changes so far.