fix: check .git/info/exclude before adding .osgrep to .gitignore#86
Conversation
WalkthroughThis change refactors internal Gitignore handling in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Hello! I've been using
osgrepvia specialized subagents1 more and more and noticed that it adds the.osgrepfile to the.gitignoreif it doesn't already include it. However, it doesn't check for the.git/info/exclude, another file that is used to ignore files.In addition, it doesn't check yet for a global excludes file, I'll create a separate PR as it requires calling
git config --get core.excludesFileinstead of "simply" reading a file.Note
Also, please note that this PR was made with assistance from a coding agent. I couldn't find anything in the docs that explicitly disallow it, but please let me know if it's an issue.
I reviewed the code and made sure it worked before opening this PR. In addition, please see the implementation session below.
Implementation session: https://buildwithpi.ai/session/?b31744872cf959ab6222a7696bcc39b8
Summary from Opus:
Prevents adding a redundant
.osgrepentry to.gitignorewhen it's already present in.git/info/exclude.Changes:
fileContainsEntry()helper for checking ignore files.git/info/excludebefore.gitignoreinensureGitignoreEntry()Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Footnotes
The session linked above somewhat shows it: the Lookout subagent uses osgrep for semantic search :) ↩