Repository navigation
Conversation
panvimdoc.sh stamps today's date on the second line of every vimdoc, so regenerating documentation whose content has not changed still modifies the file. Keep a copy of the existing vimdoc, and after pandoc writes the new one, compare the two with the "Last change" date and its alignment padding ignored. When nothing else differs, restore the existing file. A change to the content, description or Vim version still updates the date. Fixes kdheepak#57
Owner
|
Hmm. I'm not sure I like this. Perhaps we shouldn't include the date by default. Users that want a date can opt into it. |
Contributor
Author
|
Yeah, that'd be even better. The only reason I didn't go for it is that since it was introduced as non-optional I thought you might not be interested. Would you like me to submit another PR? |
Contributor
Author
|
Closing this as I agree that giving the user a choice is better. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
panvimdoc.shstamps today's date on the second line of every vimdoc, so regenerating documentation whose content has not changed still modifies the file. Every day produces a diff:2025 September 25became2025 September 26and nothing else changed.panvimdoc-ignoreblocks, as long as the date has changed since the file was generated.Before #72, a
descriptionreplaced the version and date, which #57 suggested as the way to get reproducible docs. Since #72 the date line is always emitted, so that no longer works, anddatemetadata is not exposed topanvimdoc.shor the Action.panvimdoc.shnow copies the existingdoc/<project>.txtbefore running pandoc. Afterwards it compares the two files with the date on line 2, and the padding that right-aligns it, ignored. When nothing else differs, it restores the existing file, so regenerating unchanged docs leaves no diff. Any change to the content, the description or the Vim version still updates the date. Restoring the old file, instead of writing to a temporary one, leaves the pandoc invocation and the output file's permissions unchanged.The Action and the pre-commit hook both run
panvimdoc.sh, so both pick this up. Running pandoc directly with the Lua writer behaves as before. Changing only--title-date-patternkeeps the existing date until the content next changes.Two tests cover this: one where only the date would change, and one where the content changes. Without the change to
panvimdoc.sh, the first fails on the date. The full suite passes.Fixes #57