-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat/git changed paths only #349
Conversation
case Auto: | ||
return Detect(root, pathsCh) | ||
return Detect(root, gitAllFiles, pathsCh) | ||
case Filesystem: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to emit a warning if gitAllFiles is true in this case?
} | ||
// we only want to emit files that have changed when compared with the index | ||
// mod time comparison is done with EPOCH (second) precision as per the POSIX spec | ||
return entry.ModifiedAt.Truncate(time.Second) != info.ModTime().Truncate(time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the entry.ModifiedAt coming from the git commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
1c868e1
to
22718bc
Compare
If the modified time has not changed when compared with the git index we do not emit the file for processing. This allows users to introduce treefmt to a repository without suffering an initial large formatting commit. Instead, files can be formatted incrementally as they are changed. Closes #311 Signed-off-by: Brian McGee <[email protected]>
185b47f
to
46014f8
Compare
Signed-off-by: Brian McGee <[email protected]>
46014f8
to
9cfe7db
Compare
Signed-off-by: Brian McGee <[email protected]>
56e15f1
to
352b6e8
Compare
Closing in favour of #439 |
If the modified time has not changed when compared with the git index we do not emit the file for processing.
This allows users to introduce treefmt to a repository without suffering an initial large formatting commit.
Instead, files can be formatted incrementally as they are changed.
TODO
Closes #311