Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Ensure generated template modtime is Unix epoch #50

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Sep 25, 2019

vsfgen which we use for maintaining an embedded copy of our templates
does also include the modtime of the files.

This poses a problem in combination with git, as in a project managed
by git the modtime of a file depends on the time it was changed
through a local git action (e.g. a checkout from a different state
which results in a file write on disk) instead of the time of the
actual change.

This commit adds a wrapper around http.FileSystem that modifies
the file mod times to always return Unix epoch. So that the only
things resulting in a new generated_template.gogen.go are folder
and/or file content changes.

vsfgen which we use for maintaining an embedded copy of our templates
does also include the modtime of the files.

This poses a problem in combination with git, as in a project managed
by git the modtime of a file depends on the time it was changed
through a local git action (e.g. a checkout from a different state
which results in a file write on disk) instead of the time of the
actual change.

This commit adds a wrapper around `http.FileSystem` that modifies
the file mod times to always return Unix epoch. So that the only
things resulting in a new `generated_template.gogen.go` are folder
and/or file content changes.
@hiddeco hiddeco merged commit 635c3c4 into master Sep 25, 2019
@hiddeco hiddeco deleted the build/modtime-unix-epoch branch September 25, 2019 07:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants