opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

feat: enhance ignore file support with local and global configurations

Open Sma1lboy opened this issue 3 months ago • 0 comments
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 .opencommitignore files. Added examples for each type and clarified priority rules (local rules override global rules).

Code Enhancements:

  • src/utils/git.ts:
    • Imported existsSync from fs and homedir from os to enable checking for and locating global ignore files.
    • Modified the getOpenCommitIgnore function to:
      • Check for a global .opencommitignore file in the user's home directory and apply its rules if present.
      • Retain support for local .opencommitignore files, with local rules taking precedence over global rules.

Sma1lboy avatar Aug 02 '25 00:08 Sma1lboy