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

Remove git root from CodeFileManager, FileEdit #274

Merged
merged 27 commits into from
Dec 5, 2023
Merged

Conversation

waydegg
Copy link
Contributor

@waydegg waydegg commented Nov 12, 2023

This PR removes git_root from CodeFileManager and FileEdit, making SESSION_CONTEXT.cwd the root path to join any relative file paths to.

  • FileEdit.file_path is now validated during instantiation. The value must be a Path type and must be absolute.
  • CodeFileManager.file_lines now expects all keys to be absolute paths instead of relative paths.

This PR is part of a series of PRs to remove git_root from Mentat, and allow Sessions to be run anywhere on the filesystem.

mentat/code_file_manager.py Outdated Show resolved Hide resolved
mentat/parsers/file_edit.py Outdated Show resolved Hide resolved
tests/code_file_manager_test.py Show resolved Hide resolved
Copy link
Member

@PCSwingle PCSwingle left a comment

Choose a reason for hiding this comment

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

LGTM!

Base automatically changed from remove-git-root-2 to main December 5, 2023 02:12
@waydegg waydegg merged commit b8d90b8 into main Dec 5, 2023
16 checks passed
@waydegg waydegg deleted the remove-git-root-3 branch December 5, 2023 02:17
@PCSwingle PCSwingle mentioned this pull request Dec 5, 2023
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.

3 participants