Update "dirty" file only when GitIsDirty
changes
#184
Merged
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.
This change fixes what looks like a bug in the current implementation of the
_GitRoot
target: namely, that the target always appends a0
or1
, on a new line, to the_GitIsDirtyFile
every time said target runs, causing all other targets that depend on it as an input to always rerun as well. Ultimately, this breaks incremental builds of projects that rely on theGitInfo
package.With this change, the
_GitIsDirtyFile
behaves as its logic appears to have been intended to: instead of always appending the current value of$(GitIsDirty)
to the file, the current value of($GitIsDirty)
will replace the file's contents if and only if the value differs from what's already in the file. Otherwise, the file remains untouched and all other targets that use it as an input will function as expected in incremental builds.This fixes or at least significantly mitigates the problems described in #183.