Move metadata into .gitmastery folder#65
Open
jiaxinnns wants to merge 1 commit intogit-mastery:mainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Git-Mastery on-disk layout by moving root-level metadata files into a dedicated .gitmastery/ directory, and adds an automatic migration path for existing installs.
Changes:
- Move root config from
.gitmastery.jsonto.gitmastery/config.jsonand update root discovery accordingly. - Move log file from
.gitmastery.logto.gitmastery/gitmastery.logand update the logging handler path resolution. - Add a startup migration that relocates legacy metadata files into the new
.gitmastery/folder, and update e2e setup assertions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/commands/test_setup.py | Updates e2e expectations to assert new .gitmastery/ config/log locations. |
| app/logging/setup_logging.py | Writes logs to .gitmastery/gitmastery.log and finds root via new config path. |
| app/hooks/in_gitmastery_root.py | Detects Git-Mastery root using .gitmastery/config.json instead of the legacy root file. |
| app/configs/gitmastery_config.py | Introduces new folder/name constants and adds a migration helper for legacy layouts. |
| app/commands/setup_folder.py | Creates .gitmastery/ during setup and writes the config under it. |
| app/cli.py | Triggers migration at CLI startup and warns when a migration occurred. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+77
to
+79
| new_dir = root / GITMASTERY_FOLDER_NAME | ||
| if new_dir.exists(): | ||
| return None |
Comment on lines
+39
to
+41
| os.makedirs(GITMASTERY_FOLDER_NAME, exist_ok=True) | ||
| os.makedirs(PROGRESS_LOCAL_FOLDER_NAME, exist_ok=True) | ||
| with open(".gitmastery.json", "w") as gitmastery_file: | ||
| with open(f"{GITMASTERY_FOLDER_NAME}/config.json", "w") as gitmastery_file: |
Comment on lines
+32
to
+34
| if migrate_to_gitmastery_folder() is not None: | ||
| warn("Migrated .gitmastery.json and .gitmastery.log into .gitmastery/ folder.") | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #63
RFC: https://docs.google.com/document/d/1AoZzcd4NszyymNpniamX60HFXfrsckDmtyWC9d5i75I/edit?tab=t.0