1

I am writing a Git hook in file commit-msg using python.

Purpose is to make sure that commit messages contains the type of work done with code to better manage CI/CD pipelines, like "Debug-activity performed: " OR "Test-activity performed: "

Now I have to write Debug... OR Test... in every commit message, when performing "git commit -m "Debug... OR Test..."

There are some files in the project like readme.txt that require not to mention Debug OR Test in commit message.

Now i am wondering how can i mention the "readme.txt" file in hook file so that these hook rules ignore that project file, when committing that project file with any other message in "commit - m"

One possible manual way is to use --no-verify with the git command but i am looking for a way to accomplish it through code.

Thanks in advance, Saqib

0 Answers0