Skip to content

Move metadata into .gitmastery folder#65

Closed
jiaxinnns wants to merge 1 commit intogit-mastery:mainfrom
jiaxinnns:enhancement/gitmastery-folder
Closed

Move metadata into .gitmastery folder#65
jiaxinnns wants to merge 1 commit intogit-mastery:mainfrom
jiaxinnns:enhancement/gitmastery-folder

Conversation

@jiaxinnns
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.json to .gitmastery/config.json and update root discovery accordingly.
  • Move log file from .gitmastery.log to .gitmastery/gitmastery.log and 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 thread app/cli.py
Comment on lines +32 to +34
if migrate_to_gitmastery_folder() is not None:
warn("Migrated .gitmastery.json and .gitmastery.log into .gitmastery/ folder.")

@jiaxinnns
Copy link
Copy Markdown
Contributor Author

jiaxinnns commented Apr 2, 2026

Closing as the team has decided on a different approach which would be easier to re-implement from scratch.

New PR: #105

@jiaxinnns jiaxinnns closed this Apr 2, 2026
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.

Moving metadata into .gitmastery folder

2 participants