pawamoy / git-changelog

Automatic Changelog generator using Jinja2 templates.
https://pawamoy.github.io/git-changelog
ISC License
135 stars 34 forks source link

feature: per directory changelog ? #90

Open DexterMagnific opened 1 month ago

DexterMagnific commented 1 month ago

Hello,

Would it be easy to add the ability to generate changelogs for specific directories in the repo ? The rationale behind this is that our repo is organized as a "plugins" repository and we would like to know the changes specific to each one, in addition to the current changelog that contains everything.

Thank you

pawamoy commented 1 month ago

Hello, thanks for the request :slightly_smiling_face:

That's an interesting use-case. I suppose that you could filter commits based on what files they touched, that is if we provided some kind of hooks to do that :thinking: I'll think about it :slightly_smiling_face: Always wanted to allow hooking into the Commit objects anyway, to allow inferring or modifying data.

To answer your question, it would not be easy or trivial. But this is doable.

Also, have a look at git-cliff, maybe they have such a feature already!

DexterMagnific commented 1 month ago

If you're using a form of 'git log' to get the list of commits, then 'git log

' will only list the commits that affect the given subdirectory. Maybe supporting the subdir as an argument would help.

DexterMagnific commented 1 month ago

In https://github.com/pawamoy/git-changelog/blob/main/src/git_changelog/build.py#L339, you can add a new arg for the subdir for example.

pawamoy commented 1 month ago

will only list the commits that affect the given subdirectory

Ah that's right, thanks! Then it should be easy to implement yes :)