-
Notifications
You must be signed in to change notification settings - Fork 779
display real change time stamps in directory listing #4087
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
Comments
The limitation of this approach is that directory based timestamps will remain the same. A different approach would be to use the index documents - there are already per directory documents for the LOC counts. The LOC documents currently do not store a timestamp but that could be easily changed in |
The trouble with the per directory dates derived from changeset dates is that while the LOC documents can be used for file changes/additions (grab the date from the latest history entry in file history cache and register it with the count aggregator), if there is a single removed file in a directory tree and no other changes (i.e. incremental reindex that arrived to a situation where there is a single changeset introduced since the last time the indexer was run and that changeset contains just a removal of single file), there is no reasonable way how to extract the date of the changeset that removed the file and pass it on. So, I am thinking about implementing this just for regular files and leave the directory dates reflect their file system time, however I am not sure if that would not be confusing. |
I think it is confusing to mix dates coming from indexing job and dates coming from commits. |
Thanks for the feedback @ChristopheBordieu. Another alternative would be to avoid displaying the directory dates and fetch the regular file dates from history cache. |
One thing I like about the file dates coming from history cache is that it also allows to display information about the last commit in the file listing, say in the form of some hovering window when one passes mouse cursor over the file name. |
I think it is a good idea, at least for Git repositories. For other SCMs, maybe different managements would be needed. |
The problem with directory listing currently is that it uses file-system time stamps which can be a bit misleading. If the mirror of particular repository was around long enough, then the timestamps would reflect the changes in individual files, however for repositories reindexed from scratch, the time stamps of files will be initially the same. The file-system time stamps might reflect the history of the files or might not.
Code wise, this would change this:
opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java
Lines 685 to 691 in 8a7aa08
Once the file history cache is converted to use suitable serialization scheme is implemented for #3539, it would make it possible to address this limitation by manually decoding the part of serialized history that contains the latest changeset date (to avoid unnecessary I/O), similarly how this is done in
FileAnnotationCache
to retrieve the revision ID.The text was updated successfully, but these errors were encountered: