-
Notifications
You must be signed in to change notification settings - Fork 525
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
ProjectFile.save with forceTouch to only modify the last write time without content if unchanged #1493
Merged
Merged
ProjectFile.save with forceTouch to only modify the last write time without content if unchanged #1493
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It changes the logic previously present.
When the file wasn't present, it was created by the
save true project
call.Please adjust accordingly.
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.
It does not change any behavior as before the touching was only exposed indirectly through routines where the file was known to be present.
But I agree,
touch
is typically expected to create the file if not present. Since it is exposed directly now, we better adapt it to follow that expectation.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.
You maybe right about the way how it was ever accessed, but my comment was based on the how the logic is written in the save function and how it changed in the touch. I mean
touch
was intended to be equivalent tosave true
, right? No matter in which context is ever called.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.
No - touch is not intended to change the file content, only to make the file appear as if it had changed. Just like the touch tool on unix. The primary use case is to help msbuild incremental build detect it needs to rebuild a project.
Maybe it was a mistake to expose it as member?
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.
I was a little bit incorrect in my wording,
touch
was intended to replace thesave true
call.But you're right, why should it be there in first place?
The project file should know the own state, whether it's changed or not, right? So
save true
could actually utilize this knowledge to decide whether to simply change the last access date or write out the contents.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.
On second thought - maybe it would make more sense to slightly change the behavior of
save
instead of adding touch, along the lines of: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.
Seems we've come to the same conclusion concurrently ;)