gitchangelog icon indicating copy to clipboard operation
gitchangelog copied to clipboard

[Enhancement] - Add files information for the filtering of sections

Open alexsapran opened this issue 6 years ago • 5 comments

Context First of all I would like to say thanks for this nice project. I am working on a monorepo project that we split down the functionality based on the paths. Example: UI: <gtit-root>/ui/ API: <git-root>/api infra: <git-root>/infra .....

So I can use to filter the subject that covers around 50% of the cases. But I was interested if we could make the same section-filtering on the subject + the path of the file that this commit has changed.

Something like:

files_regexps = [
    ('UI', [
        r'^\/(ui)\/*',
     ]),
    ('API', [
        r'^\/(api)\/*',
     ]),
      .....
]

And that sections would be merged witht the section_regexps

alexsapran avatar Nov 20 '18 14:11 alexsapran

Thanks for your suggestion and your interest in gitchangelog. May I ask you what to do in case there are modification in files matching 2 different path ?

vaab avatar Nov 20 '18 15:11 vaab

May I ask you what to do in case there are modification in files matching 2 different path

I am not sure I understand your question completely. I would assume whatever match last will get the section.

For example

files_regexps = [
    ('UI', [
        r'^\/(ui)\/*',
     ]),
    ('API', [
        r'^\/(api)\/*',
        r'^\/(some-other-ui)\/*',
     ]),
      .....
]

To clarify you are reffering the case that there is a symlink in the some-other-ui to the ui folder ?

alexsapran avatar Nov 20 '18 16:11 alexsapran

Sorry if I was not clear : if you have modified files in ui/ and api/, in what section should the commit be associated with ? Is that better ?

vaab avatar Nov 20 '18 16:11 vaab

Is that better ?

yes

For my case this use case will not happen, we normally work inside each given folder. maybe my example was not very clear. I would say it can be either first match or last match. This might not be the ideal answer for all of the use cases but it works for me.

alexsapran avatar Nov 20 '18 17:11 alexsapran

Now that I am thinking this same regexps could be applied to the ignore lists. For example, I want to ignore anything that is in the .github folder or any dot file from the git root folder.

alexsapran avatar Nov 20 '18 17:11 alexsapran