-
Notifications
You must be signed in to change notification settings - Fork 257
feat: add option to only parse commits for current working directory #509
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
feat: add option to only parse commits for current working directory #509
Conversation
@kibidev hey 👋 just wanted to ask a question about this - how do you anticipate it will affect the changelog generation and tagging? If you run from multiple subdirectories, won't you get multiple releases/tags, and the versions for each subproject jumping outside of what the commit semantics imply?
If you configured I think it would help to have some tests to demonstrate the behaviour a bit, and some more documentation about how this would impact tagging overall 🙂 |
@bernardcooke53 Hi!
I have followed a setup as in I have not tested with Regarding documentation, I would suggest updates the the documentation for mult projects. Any other suggestions? Regarding tests, I probably will not have time to add this very soon, but I will try when I have time to spare. |
That helps understand the use-case - thanks! I think the scenario I outlined above is applicable in that case, so as you say adding some documentation explaining the limitations might help. Something like the note for I do think that there's a danger when used with if config.get("use_only_cwd_commits"): to if config.get("use_only_cwd_commits") and config.get("version_source") == "commit": That would also deserve a note in the docs that Ideally we'd implement a full solution for #168 but that's a lot more effort - before that happens, I think this is an ok halfway house. |
d2216e1
to
13d4c51
Compare
@bernardcooke53 thanks for the suggestions, I have updated the code and added a bit more documentation now. |
When running the application from a sub-directory in the VCS, the option use_only_cwd_commits will filter out commits that does not changes the current working directory, similar to running commands like `git log -- .` in a sub-directory.
13d4c51
to
8a7cd81
Compare
I have (finally) revisited this PR and evaluated the possibility to add tests. The remaining approach would be to write new tests that would mock git.Repo or similar to test get_commit_log. In my opinion the value from this would also be minimal, as it would mostly just test the mock. I will probably not add any testing to this PR, for the way forward I can suggest one of:
|
Thanks for coming back to this @kibidev - I agree with your assessment, it's a pain to test this thoroughly with the current tests. |
When running the application from a sub-directory in the VCS, the option use_only_cwd_commits will filter out commits that does not changes the current working directory, similar to running commands like
git log -- .
in a sub-directory.Relevant, but not complete solution, for #168.