Article modification dates
Closed this issue · 4 comments
When running update-website, the article modification date is the file modification date on my computer. If I were to clone the repository now, all the articles would have "now" as modification date.
Updating my fork to the texmacs/notes
parent one, there are a few articles which are taking up "today" as modification date.
Do you have any suggestion on how to get their modification date to match the ones in the repository?
Update
With a quick Internet search I found statements that git updates modification times by design. We could write a script that overrides this behaviour for the posts. I do not follow all of the details, but this is an example
At a quick look of what its author says about it, it seems written with care):
https://github.com/MestreLion/git-tools
https://stackoverflow.com/questions/1964470/whats-the-equivalent-of-use-commit-times-for-git/13284229#13284229
and (cited in the previous link)
https://repo.or.cz/w/metastore.git
Maybe my original approach to this problem is flawed then. Could be a good idea to try to get the last modification date from git log
itself. That would be great and more robust. What do you think?
Pls. give me some time. I need to understand what git
does, I have a feeling that there are git
rules that I did not yet put into my focus. Before that, I would like (since I am into it now) to understand why gmtime
puts "GMT" in output in my system and "UTC" in yours :-) so to be able to update the website with the current script and so add the abstract to the macro-editor file.
For that:
I have till now half-understood that the assignment happens at the gmtime
C function, which is based on an extern variable called _tmbuf
(declared in time.h
and according to time.h
defined in localtime.c
). But I do not know what sets that variable and to what.
I am not able to get the script to output "UTC". I am opening a separate issue.
Git just do not care about modification times, it seems. So I was wrong to rely on the date in a git repository in the first place. One could infer the time of the last commit which modified the file and then use this date. I've modified the algorithm. It should work now (commit cc552e2)