Skip to content

🚧 Add EntryName::from_absolute_path_lossy#2191

Merged
ChanTsune merged 2 commits into
mainfrom
lib/rename-internal-function
Dec 3, 2025
Merged

🚧 Add EntryName::from_absolute_path_lossy#2191
ChanTsune merged 2 commits into
mainfrom
lib/rename-internal-function

Conversation

@ChanTsune
Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ChanTsune, 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 enhances the EntryName type by introducing a new constructor that supports preserving absolute path components, providing greater flexibility for path handling. It also refactors existing path sanitization logic into a dedicated utility function, improving modularity and maintainability of the codebase.

Highlights

  • New Path Sanitization Utility: Introduced sanitize_utf8path in lib/src/util/utf8path.rs to centralize the logic for removing special path components (like . .. / and prefixes) from Utf8Path instances.
  • Refactored EntryName Constructor: The EntryName::new_from_utf8path method was updated to utilize the newly introduced sanitize_utf8path utility, streamlining its implementation and improving code reusability.
  • Absolute Path Preservation: A new public function, EntryName::from_absolute_utf8path, has been added. This constructor allows creating EntryName instances from Utf8Paths while explicitly preserving absolute path components (e.g., a leading /), offering more control over path representation compared to the existing sanitizing constructor.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new function EntryName::from_absolute_utf8path for creating an EntryName while preserving absolute path components, and refactors path sanitization logic into a new helper function. The changes are well-structured and improve the codebase. I have a couple of suggestions to enhance the new API's clarity and to make a helper function more idiomatic.

Comment thread lib/src/entry/name.rs
Comment thread lib/src/util/utf8path.rs Outdated
@github-actions github-actions Bot added the lib This issue is about lib crate label Oct 3, 2025
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch from f8b41ba to f559ab8 Compare October 6, 2025 08:14
Comment thread lib/src/entry/name.rs Fixed
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch from f559ab8 to 092f57d Compare October 6, 2025 08:42
@ChanTsune ChanTsune marked this pull request as draft October 6, 2025 13:06
@github-actions github-actions Bot added the break API braking change label Oct 6, 2025
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch from eb2414e to 74eded9 Compare October 7, 2025 05:35
@github-actions github-actions Bot removed the break API braking change label Oct 7, 2025
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch 2 times, most recently from 27ed47e to 2e77e6a Compare October 31, 2025 07:45
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch from 2e77e6a to a05d03c Compare November 30, 2025 00:32
Comment thread lib/src/entry/name.rs Fixed
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch 3 times, most recently from 6edf195 to 7c0c151 Compare November 30, 2025 05:56
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch 3 times, most recently from 879b3b5 to af17720 Compare December 3, 2025 08:25
@ChanTsune ChanTsune force-pushed the lib/rename-internal-function branch from af17720 to ad77480 Compare December 3, 2025 09:42
@ChanTsune ChanTsune marked this pull request as ready for review December 3, 2025 13:50
@ChanTsune ChanTsune merged commit e7cc0ee into main Dec 3, 2025
98 of 99 checks passed
@ChanTsune ChanTsune deleted the lib/rename-internal-function branch December 3, 2025 13:50
@ChanTsune
Copy link
Copy Markdown
Owner Author

close #2177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib This issue is about lib crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add EntryName::from_absolute_path and EntryReference::from_absolute_path

2 participants