opencommit
opencommit copied to clipboard
feat: enhance ignore file support with local and global configurations
trafficstars
issue: #344
This pull request enhances file ignore functionality in OpenCommit by introducing support for global ignore files, improving usability and flexibility. The changes include updates to the documentation and the implementation of the ignore file handling logic.
Documentation Updates:
README.md: Updated to describe the support for both local and global.opencommitignorefiles. Added examples for each type and clarified priority rules (local rules override global rules).
Code Enhancements:
src/utils/git.ts:- Imported
existsSyncfromfsandhomedirfromosto enable checking for and locating global ignore files. - Modified the
getOpenCommitIgnorefunction to:- Check for a global
.opencommitignorefile in the user's home directory and apply its rules if present. - Retain support for local
.opencommitignorefiles, with local rules taking precedence over global rules.
- Check for a global
- Imported