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

Option to report only changed files #32

Open
StarpTech opened this issue Aug 28, 2018 · 10 comments
Open

Option to report only changed files #32

StarpTech opened this issue Aug 28, 2018 · 10 comments
Labels
🗄 area/interface This affects the public interface help wanted 🙏 This could use your insight or help 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have 🙆 yes/confirmed This is confirmed and ready to be worked on

Comments

@StarpTech
Copy link
Contributor

As titled. The quiet options will print also untouched files.

@wooorm
Copy link
Member

wooorm commented Aug 28, 2018

Closest to this is the --watch argument on the CLI (unified-args)

This is pretty interesting, but not doable easily. E.g., what is a “change”?

  • Is that a change in the contents of a file?
  • Or a different file path (file.path !== file.history[0])
  • Should we start supporting stats, and track changes to mode, mtime, and the like?

I think this would be roughly related to GH-22 too.

@StarpTech
Copy link
Contributor Author

Yes, it's a change in the original file when I use output: true

@StarpTech
Copy link
Contributor Author

Why it should be related to a cache?

@wooorm
Copy link
Member

wooorm commented Aug 28, 2018

It doesn’t have to be, but my above three points are also what’s needed for caching. Albeit that “changed” files, as described above, relate to comparing a file before processing to after processing, whereas caching compares them between processes.

@wooorm wooorm added the 🙉 open/needs-info This needs some more info label Aug 28, 2018
@StarpTech
Copy link
Contributor Author

OK I got but for clarification my issue is only about to list which files are touched. Touch means as soon as I change the original content of the file (option: output).

@wooorm
Copy link
Member

wooorm commented Aug 28, 2018

Wait, are you talking about written files, instead of “changed” files?

@StarpTech
Copy link
Contributor Author

No, I'm talking about updated files. List all written files is already supported but it doesn't help because it shows all found files based on the pattern.

@wooorm
Copy link
Member

wooorm commented Aug 28, 2018

Well, that’s hard. And then we need a definition of changed, and my proposal in my first comment is that I believe?

@StarpTech
Copy link
Contributor Author

Yes. My proposal: changed means when source content != content (after processing). It doesn't matter if the content is saved to a different location when the content was changed.

@wooorm
Copy link
Member

wooorm commented Apr 23, 2019

First what we need to figure out is how to check if file.contents (string or buffer) equals a file on disk. I’m thinking node-stream-equal could work, if file.contents was made into a stream.
Any other thoughts?

Next steps would be to wrap that in a vfile-matches-file-on-disk utility (which obviously needs a better name). And then to filter the files here using that utility if a flag is set.

@wooorm wooorm added 🗄 area/interface This affects the public interface 🙆 yes/confirmed This is confirmed and ready to be worked on 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change help wanted 🙏 This could use your insight or help and removed 🙉 open/needs-info This needs some more info labels Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface help wanted 🙏 This could use your insight or help 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have 🙆 yes/confirmed This is confirmed and ready to be worked on
Development

No branches or pull requests

2 participants