Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/pre commit #449

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

majiayu000
Copy link

Hi!

I've added a commit message caching feature.

I implemented this because my pre-commit checks frequently failed, and yesterday I consumed 40k tokens for a single commit attempt.

For the caching system, I followed the XDG specification and stored the cache in the ~/.cache directory.

…and performance

The commit introduces new configuration options for logging and caching in OpenCommit. Users can now enable/disable logging and caching, and customize the directories for storing logs and cache files. This improves debugging capabilities, performance optimization, and pre-commit hook integration. The changes include updates to the README.md documentation, configuration handling in config.ts, and enhancements to the commit cache and logger utilities.
@di-sukharev
Copy link
Owner

@majiayu000 hi, thank you for the contribution. could you describe in few words how it works pls? there is also a broken test

Comment on lines +16 to +24
execSync(`
mkdir -p "${TEST_REPO}"
cd "${TEST_REPO}"
git init
git config user.name "test"
git config user.email "test@test.com"
echo "test" > test.txt
git add test.txt
`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
Comment on lines +82 to +90
execSync(`
mkdir -p "${TEST_REPO2}"
cd "${TEST_REPO2}"
git init
git config user.name "test"
git config user.email "test@test.com"
echo "test2" > test2.txt
git add test2.txt
`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants