- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Option for excluding rename commits from last update #148
Conversation
…e date
I don't think we need an option for this. If there any use case where you would want this? |
You mean this should be the default behavior, without an option? I think the feature itself would be useful, because in knowledge-base and documentation projects there are often quite a lot of folder hierarchy changes, and if we consider these changes as 'last update' it could be misleading. Say for an API documentation; it was written in 2020 and never updated, which is deprecated today. And lately it was decided to be moved to another folder, and now it shows as it is updated recently, and people may think it is up-to-date, whereas it is not. The reason to have it as option and not default behavior could be; it brings an additional overhead since it runs with |
OK I had to dig back into the issue. So if we use I do want to have sensible defaults. Here's my proposal:
Would you be willing to make the changes? I can take care of the documentation |
commit_timestamp = git.log( | ||
realpath, date="unix", format="%at", n=1, no_show_signature=True | ||
realpath, date="unix", format="%at", diff_filter=diff_filter_param, n=1, no_show_signature=True, follow=follow_param |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that with follow enabled, you will get multiple commits, and you need to take the last one. See the logic used for the creation date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't n=1
also achieve the same desired effect as selecting the last one using commit_timestamp = commit_timestamp.split()[-1]
?
I saw that and though maybe it is just awaiting refactoring.
If it doesn't achieve the same result, I can do it like the creation date.
Sure @timvink, though I didn't fully wrap my head around it I'll try to implement these. If it gets way above my head I'll let you know 😄 |
…follow introduced, added additional parameter for revision changes, diff-filter "r" is added for both creation and revision commit histories
Hi @timvink, just pushed the changes:
About the
We can always add the I got one question though; why did we add diff-filter "r" for creation dates as well? I was trying to come up with a case where it would make a difference but couldn't think of any, could you describe a case for it please? And for the manual tests, here's the difference between
Please note September 24, 2024 is the date I moved all files to another directory. In conclusion: based on the test outputs, I think it achieves what we are looking for. Let me know if you need additional changes or tests. I'm here to help. Thank you |
Nice work!
I assume speed. Not sure anymore tbh.
Cool!
Almost there! |
Certainly @timvink, I'm slightly busy nowadays but no worries I'll let you know once I update the PR, stay tuned. Thank you. |
Hi @timvink. Sorry for the delay, I was busy with relocating. Can you take a quick look and see if it's up to par? |
Great stuff, thanks for all your effort to push this! |
Will make a release this weekend |
Brilliant, cheers! |
Discussed and proposed in #147
Did a couple of tests using one of my repositories where the aforementioned problem is present. Looking good so far.
This is just a draft PR, do not merge yet. Populate the TODO below if I'm missing something
TODO:
mkdocs serve