fix(core): handle line endings in ignore file parsing#23895
fix(core): handle line endings in ignore file parsing#23895cynthialong0-0 merged 2 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue with incorrect handling of various line endings in ignore file parsers. By updating the splitting mechanism, it ensures that ignore patterns are consistently applied across different operating systems, improving the reliability and cross-platform compatibility of file exclusion logic. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the GitIgnoreParser and IgnoreFileParser to use a more robust line splitting mechanism. The change from split('\n') to split(/\r\n|\n|\r/) ensures that files with different line ending conventions (CRLF, LF, or CR) are parsed correctly. There is no feedback to provide.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
|
This makes it harder to contribute to simple issues that have been sitting in the backlog for a long time. However, I understand that this approach may be fair for optimizing time and resource allocation. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the GitIgnoreParser and IgnoreFileParser in the core package to handle various line ending formats (LF, CRLF, and CR) when splitting file content into patterns. This ensures better cross-platform compatibility for ignore file parsing. I have no feedback to provide.
Summary
Fixed incorrect handling of different line endings (CRLF, LF, CR) in ignore file parsers. Changed
split('\n')tosplit(/\r\n|\n|\r/)in bothGitIgnoreParserandIgnoreFileParserto match Git's behavior and ensure cross-platform compatibility (Windows CRLF, Unix LF, legacy Mac CR).Details
Related Issues
Fixes #23891
How to Validate
Create a test project and initialize Git. Create a .gitignore file with CRLF line endings. Run the Gemini CLI file reading command.
Expected result: Files from .gitignore should be ignored (skipped).
Pre-Merge Checklist