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
Update man pages with current date and curl/libcurl version number when running maketgz #1058
Conversation
@sbrokenshire, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bagder, @captain-caveman2k and @yangtse to be potential reviewers. |
Whoops. Hold on with this one. Just noticed the packages don't include the script I've added. :/ Edit: Now fixed. |
My only hesitation about doing this, is that it makes it harder for users who want to run diff to see what changed and this scripts unconditionally updates all man pages disregarding if they are identical or not. Would it make sense to also mark the page somehow that it was updated (and then we can commit the updates too) so that repeated runs only would update those that actually were changed since the previous run? |
Hmm... having given some thought about it... What about having a file that has a list of man pages with hashes, compare with the hash in the list with the hash for the actual file. If it has changed then update otherwise leave alone? Also have the script check for deleted man pages and remove them from the list as needed when it runs. |
Oh hey, I came to think of another approach! If we assume or require that the user who runs this script does it in the checked-out git repo (which I think is a fair requirement), then we can just check with git if there has been any changes in the given file since the date used in the file! Like this:
It has the nice upside that anyone can run the script at any time without having to store any additional hashes or similar. |
Altered script to use the git repository and update the man pages if needed. Edit: Eek. A bit too long that commit message. :/ |
I played around with this a bit and I've thought about some things:
The downside with (2) would be that it doesn't update the date/version in git, but I'm not sure that matters a whole lot. If there would be anything else, it would be that this script uses different indenting and slightly different code style than other perl scripts in our repo do. Thoughts? |
I've applied your patch and made a couple of alterations to the script and it now generates the updated man pages with the ".dist" extension. At the moment, I have an issue with certain man pages when it runs git log in that it returns data each time when it shouldn't. If I do I'll bring the code style of the script into line with the other perl scripts in the repo and then push those changes to my local repo. |
This starts to look really good. Can you please squash the commits so that we can review the current state (and merge) easier? |
Great! I'll squash my commits. Can I also group/reword my commits together (as I did a bit of pulling for other changes) when doing the rebase or is that going to cause issues when merging? |
You're free to squash and rearrange them as you want to make the commit(s) look nice and tidy, then you just push -f the cleaned up set to the branch. |
I've squashed the commits and pushed them. There are two commits for the Makefile.am files since squashing them doesn't make sense for me. Edit: Forgot to ask... five commits okay or is one commit prefered? |
Added script to update man pages to use the current date and curl/libcurl versions. updatemanpages.pl has three arrays: list of directories to look in, list of extensions to process, list of files to exclude from processing. Check man page in git repoistory using the date from the existing man page before updating to avoid updating the man page if no change is made. If data is received from the git command then update the man page with the current date and version otherwise leave alone. Applied patch from badger to make the date argument optional, change the git command used, added date argument to processfile subroutine and print to STDERR if no date is found in a man page. Added code to process the changed man page into a new man page with .dist added to the filename to keep the original source files unchanged. Updated POD documentation to reflect that the date argument optional. Code style is in line with CODE_STYLE.md. Directories: docs/ docs/libcurl/ docs/libcurl/opts/ tests/ Extensions: .1 .3 Excluded files: mk-ca-bundle.1 template.3 (TODO Section 3.1)
Ignore man page dist files generated by scripts/updatemanpages.pl
maketgz now runs scripts/updatemanpages.pl to update the man pages .TH section to use the current date and curl/libcurl version. (TODO Section 3.1)
As it's been a while since I've worked on this... is there anything else that should be added? |
Thanks for bringing back my attention to this PR and for your patience. Things look fine and I will merge! |
Added scripts/updatemanpages.pl script to update (with exception of docs/mk-ca-bundle.1 and docs/libcurl/opts/template.3) the man pages with the current date and curl/libcurl version passed to it from maketgz.
Only issue of git picking up that the man pages have changed with the updated .TH section.
(TODO Section 3.1)